I'm trying to order the result of joining my Users table to my UserContacts table.
I get three columns:
idContacts
firstName
lastName
the field
idContacts may or may not be NULL.
If
idContacts is NULL, I want them to appear at the end of the list.
I tried doing:
Code:
ORDER BY idContacts DESC, lastName
But the first ordering rule screws with the second one - it does now list people who do have an
idContacts first, but it orders them by
idContacts rather than
lastName.
I want to shove all the people without an
idContacts to the bottom of the list, and then order by
lastName.
Is this possible?