Hello
I have a database with records that contain timestamp columns for submit and expire. Currently I order by submit so that the most recently submitted record will be top of the list. And I currently do not display the expired records.
I now wish to display all records. But I want to display all non expired records first (so expire has priority) but then I want to order those non expired records in order of date submitted. Sounds straightforward enough (and probably is!) but I am struggling.
Here is what I tried:
SELECT * FROM table ORDER BY expire DESC, submit DESC;
But this mixes up the records. Do I need two queries? And if so any pointers on how?
Many thanks