Home » SQL & PL/SQL » SQL & PL/SQL » Null values top by ascending order
Null values top by ascending order [message #440900] Wed, 27 January 2010 19:33 Go to next message
ap_karthi
Messages: 87
Registered: October 2007
Location: Bangalore
Member
Hello,

I want to sort a column by ascending order but null values should be shown in the first. How?

Thanks.

-Karthik
Re: Null values top by ascending order [message #440901 is a reply to message #440900] Wed, 27 January 2010 19:37 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2168299

NULLS FIRST | NULLS LAST
Specify whether returned rows containing null values should appear first or last in the ordering sequence.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

[Updated on: Wed, 27 January 2010 19:38]

Report message to a moderator

Re: Null values top by ascending order [message #440906 is a reply to message #440901] Wed, 27 January 2010 21:59 Go to previous message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Just add some more to Blackswan`s post...

Quote:
NULLS FIRST | NULLS LAST
Specify whether returned rows containing null values should appear first or last in the ordering sequence.

NULLS LAST is the default for ascending order, and NULLS FIRST is the default for descending order.



sriram Smile

[Updated on: Wed, 27 January 2010 22:18]

Report message to a moderator

Previous Topic: Query to fetch all the months in a year using connect by (merged 3)
Next Topic: Simple SQL query
Goto Forum:
  


Current Time: Fri Dec 09 03:37:00 CST 2016

Total time taken to generate the page: 0.24979 seconds