SELECT `t3`.`id_member`, `t3`.`month`, `t3`.`count`
FROM (
SELECT `month`, MAX(`count`) AS `maxcount`
FROM (
SELECT DATE_FORMAT(FROM_UNIXTIME(`poster_time`),'%Y-%m') AS `month`,
COUNT(*) AS `count`
FROM `messages`
GROUP BY `id_member`, `month`
) AS `t1`
GROUP BY `month`
) AS `t2`
JOIN (
SELECT DATE_FORMAT(FROM_UNIXTIME(`poster_time`),'%Y-%m') AS `month`,
COUNT(*) AS `count`, `id_member`
FROM `messages`
GROUP BY `id_member`, `month`
) AS `t3` ON `t3`.`month` = `t2`.`month`
AND `t3`.`count` = `t2`.`maxcount`
ORDER BY `t3`.`month`
SELECT `a`.`name`, IFNULL(`d`.`count`, 0) AS `count`
FROM `authors` AS `a`
LEFT JOIN (
SELECT `author`, COUNT(*) AS `count`
FROM `docs`
GROUP BY `author`
) AS `d` ON `d`.`author` = `a`.`id`
UNION (SELECT CONCAT('Неизвестный ', IFNULL(`d`.`author`, '')), `d`.`count`
FROM `authors` AS `a`
RIGHT JOIN (
SELECT `author`, COUNT(*) AS `count`
FROM `docs`
GROUP BY `author`
) AS `d` ON `d`.`author` = `a`.`id`
WHERE `a`.`id` IS NULL)
ORDER BY `count` DESC
$text = preg_replace("/(?<=[а-яё:;,.])\s*•/ismu", " <br>•", $text);
replacement may contain references of the form \\n or (since PHP 4.0.4) $n, with the latter form being the preferred one. Every such reference will be replaced by the text captured by the n'th parenthesized pattern.
SELECT *
FROM `db_images` AS `i1`
JOIN `db_images` AS `i2` ON `i1`.`image_hash` = `i2`.`image_hash`
AND `i1`.`image_id` != `i2`.`image_id`
JOIN `db_apartments_images_links` AS `a1` ON `a1`.`image_id` = `i1`.`image_id`
JOIN `db_apartments_images_links` AS `a2` ON `a2`.`image_id` = `i2`.`image_id`
AND `a1`.`apartment_id` = `a2`.`apartment_id`
...
`time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
...
$ sudo ls -l /var/spool/cron/
итого 12
drwxrwx--T 2 daemon daemon 4096 апр. 1 2013 atjobs
drwxrwx--T 2 daemon daemon 4096 июня 11 2012 atspool
drwx-wx--T 2 root crontab 4096 июля 13 11:25 crontabs
sudo ls -l /var/spool/cron/crontabs
итого 4
-rw------- 1 rsa crontab 1104 июля 13 11:28 rsa