Possible Duplicate:
MySQL Orderby a number, Nulls last
I have a table with columns like this.
NULL
NULL
2012-10-12
NULL
2013-10-17
2012-10-17
I want to sort the date fields in asc and the NULL values to go to the last, to get something like this
2012-10-12
2012-10-17
2013-10-17
NULL
NULL
NULL
I did select xyz from table order by xyz.abc asc;
which prints the reverse of this.
Also, played around the order_by with case
and IF
functions, but couldn't get.