ORDER by NULLs first then values
Posted: Tue Feb 24, 2009 6:30 am
Hello, quick question which I'm not sure is even possible, but I would have a table like with two columns, an ID and a UNIX timestamp when the event is complete, so the table looks something like:
However, I would like the query to order the rows with 'NULL' in the date column first and then order the remaining rows by the date DESC, so:
Anyone know if this is possible?
Code: Select all
id date
1 1234567890
2 NULL
3 6789012345
4 NULL
5 8901234567Code: Select all
id date
2 NULL
4 NULL
1 1234567890
3 6789012345
5 8901234567