MySQL PHP mysql Group By는 첫 번째 레코드가 아닌 최신 레코드를 얻습니다.
탁자: (`post_id`, `forum_id`, `topic_id`, `post_time`) (79, 8, 4, '2012-11-19 06:58:08'); (80, 3, 3, '2012-11-19 06:58:42'), (81, 9, 9, '2012-11-19 06:59:04'), (82, 11, 6, '2012-11-19 16:05:39'), (83, 9, 9, '2012-11-19 16:07:46'), (84, 9, 11, '2012-11-19 16:09:33'), 쿼리 : SELECT post_id, forum_id, topic_id FROM posts GROUP BY topic_id ORDER BY post_time DESC LIMIT 5 결과 : [0] => [post_id] => 84 [for..
2021. 1. 19.