Showing posts with label endnormally. Show all posts
Showing posts with label endnormally. Show all posts

Wednesday, March 21, 2012

ORDER BY ASC with NULL at the end

Hi,
How can I do an ORDER BY so the records with NULL will be at the end?
normally the order is like this: "NULL, A, B, C", but I woudl want to have
"A, B, C, NULL".
Thanks a lot in advance!
Pieterorder by case when col1 is null then 1 else 0 end, col1|||Alexander Kuznetsov wrote:
>order by case when col1 is null then 1 else 0 end, col1
or just use the isnull() function in the select and make null values be show
n
as whatever u want that will be at the end of the list?

ORDER BY ASC with NULL at the end

Hi,
How can I do an ORDER BY so the records with NULL will be at the end?
normally the order is like this: "NULL, A, B, C", but I woudl want to have
"A, B, C, NULL".
Thanks a lot in advance!
Pieter
order by case when col1 is null then 1 else 0 end, col1
|||Alexander Kuznetsov wrote:
>order by case when col1 is null then 1 else 0 end, col1
or just use the isnull() function in the select and make null values be shown
as whatever u want that will be at the end of the list?
sql