select last row for each group

4 years ago

Matúš Matula
Backer | 243
+
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

`

4 years ago

CZechBoY
Member | 3408
+
+1
-

It is not possible…

4 years ago

Matúš Matula
Backer | 243
+
0
-

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