- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
SELECT * FROM (
SELECT `comments`.`user`,
`comments`.`time`,
`comments`.`topic`,
`comments`.`id` AS `commid`,
`topic`.`name`,
`topic`.`id`,
`topic`.`translit`,
`topic`.`blog`,
`user`.`login`
FROM `comments`, `topic`, `user`
WHERE
`comments`.`topic` IN (
SELECT DISTINCT `topic`
FROM `comments`
ORDER BY `time` DESC)
AND `topic`.`id` = `comments`.`topic`
AND `user`.`id` = `comments`.`user`
ORDER BY `comments`.`time` DESC
) `data`
GROUP BY `data`.`topic`
ORDER BY `data`.`time` DESC
LIMIT 10