select last row for each group

3 years ago

Matúš Matula
Backer | 236
+
0
-

How to make Database Selection for this sql?

`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

`

3 years ago

CZechBoY
Member | 3360
+
+1
-

It is not possible…

3 years ago

Matúš Matula
Backer | 236
+
0
-

thanks. I was considering replacing dibi with ndb..not gonna happen