MySQL Forums
Forum List  »  Newbie

ORDER BY that sorts NULLS last
Posted by: Reginald Brubaker
Date: May 07, 2008 02:48PM

I'm trying to sort my results by an average here, but my results have the NULLs showing up first like if I do this...

SELECT * FROM Table WHERE Col1 ORDER BY total/value

It's like this...

0
0
0
0
5
4.5
3
1

and I want the results to be like this...

5
4.5
3
1
0
0
0
0

Is there a way to sort results with the nulls last? Any help would be appreciated, thanks.

Options: ReplyQuote


Subject
Written By
Posted
ORDER BY that sorts NULLS last
May 07, 2008 02:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.