Take the 2-minute tour ×  I have searched all over and can't
manage to get this to work. I am trying to build a question that
groups my records within 5 minutes - and displays the last
entry. However I managed to get there halfway, but my query is
only returning the first entry (XX=10).  I do have the following
data:  ID        XX       DATETIME N1         5       2009-05-01
13:00:00 N1        10       2009-05-01 13:04:49 N2         7
2009-05-02 14:00:00  and I want my group by to give me this:  N1
10 N2       7  I have uses this group by statment:  ((60/15) *
HOUR(created_on) + FLOOR(MINUTE(created_on) / 15))   Any one out
there that has any ideas on how this query should look like?
Best regards, Joakim  share|improve this question Doing this for
10 minutes is mildly trivial, but it's a highly expensive
task... why do you need to group like this ? –  Khez Apr 9 '11
at 15:09 I dont follow you? Can u explain further what you mean?
–  Joakim Krassman Apr 9 '11 at 18:18 You can do GROUP BY
SUBSTR(dat