select last row for each group
Notice: This thread is very old.
- Matúš Matula
- Member | 257
How to make Database Selection for this sql?
SELECT a.*
FROM message a
INNER JOIN
(
SELECT c_id, MAX(time) time
FROM message
GROUP BY c_id
) b ON a.c_id = b.c_id AND
a.time = b.time