How to order by column with non-null values first in sql
- by devlife
I need to write a sql statement to select all users ordered by lastname, firstname. This is the part I know how to do :) What I don't know how to do is to order by non-null values first. Right now I get this:
null, null
null, null
p1Last, p1First
p2Last, p2First
etc
I need to get:
p1Last, p1First
p2Last, p2First
null, null
null, null
Any thoughts?