select last row for each group

Notice: This thread is very old.

4 years ago

Matúš Matula
Backer | 246
+
0
-

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

4 years ago

CZechBoY
Member | 3572
+
+1
-

It is not possible…

4 years ago

Matúš Matula
Backer | 246
+
0
-

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