Hey,
I am currently pulling records out of a database that need to be sorted by their priority and their date. (All the emergencys are at the top sorted by date, next medium sorted by their dates, next low sorted by their date). I am currently using a UNION to link multiple select statements for each 'priority' and ordering by timestamps. However this is a problem because UNION is so new and only compatible in new version like 4.0.0 and on. Are their better ways to do this?
(SELECT * FROM hd_tickets WHERE `priority` = 'urgent' ORDER BY `create_timestamp` ASC)
UNION
(SELECT * FROM hd_tickets WHERE `priority` = 'high' ORDER BY `create_timestamp` ASC)
UNION
(SELECT * FROM hd_tickets WHERE `priority` = 'low' ORDER BY `create_timestamp` ASC)
Thanks!
Jason