View Single Post
  #12 (permalink)  
Old 02-12-10, 08:35
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
I think this may be more of what you are looking for:

Code:
SELECT ticket.room, ticket.status, ticket.number, agenda.name
   , ticket.datum_status
    FROM ticket, agenda
WHERE ticket.status IN(3,4)
   and ticket.datum_status = (select max(ticket1.datum_status)
                                            from ticket ticket1
                                        where ticket.number = ticket1.number
                                            and ticket1.status in (3,4))
   AND agenda.idagenda = ticket.idagenda
ORDER BY ticket.datum_status DESC LIMIT 6;
Dave
Reply With Quote