Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Very needy:Changing the order in result rows

Author  Topic 

sreehari
Starting Member

37 Posts

Posted - 2006-05-31 : 05:34:02
when i am querying the table with descending order on CONTRACT_SITE_ID , i am getting the following result

CONTRACT_ID CONTRACT_SITE_ID contPartyCount
10000090772 10000150304 5
10000090772 10000150303 5
10000090772 NULL 2

now i want to display the rows having NULL values to be displayed first with out changing the sorting order of column CONTRACT_SITE_ID from desc to asc



Thanks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-31 : 05:59:55
order by isnull(CONTRACT_SITE_ID, 99999999999) desc


KH

Go to Top of Page
   

- Advertisement -