Friday, 25 March 2011

Oracle order by NULL

During ORDER BY sorts, NULL values always come first when the order is descending,
and last when the order is ascending. This default order can be changed by using the
clauses NULLS FIRST and NULLS LAST
E.g:
SELECT * FROM ACE ORDER BY 1 ASC NULLS FIRST
SELECT * FROM ACE ORDER BY 1 DESC NULLS LAST

No comments:

Post a Comment