dave, you leapfrogged right over what i was gonna teach him
betas, since you did not provide the agenda table, i removed it from the query
here's your query that i tried --
Code:
SELECT ticket.room, ticket.status, ticket.number
, MAX(ticket.datum_status)
FROM ticket
WHERE ticket.status IN(3,4)
GROUP BY ticket.number
ORDER BY ticket.datum_status DESC LIMIT 6;
and here's the data it produced --
Code:
room status number MAX(ticket.datum_status)
2 4 FELO-7 2010-02-11 16:45:28
2 3 FELO-6 2010-02-11 16:45:17
2 4 TR10/35 2010-02-11 16:41:50
2 4 TR10/21 2010-02-11 16:41:27
2 4 TR10/2 2010-02-11 16:41:12
2 4 TR10/38 2010-02-12 09:48:51
see? one row per ticket.number
notice, by the way, that the ORDER BY did not work correctly, i can explain this if you wish