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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query question about ordering

Author  Topic 

jsmith123
Starting Member

2 Posts

Posted - 2007-10-09 : 11:26:14
Hi,
I have the following query.

"select countries from tableA order by countries"

this returns a list of countries in alphabetical order. Is there a way to modify the query so that it continues to list the countries in alphabetical order but places United States at the top of the list?

Thanks.

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-10-09 : 11:42:30
[code]select countries
from tableA
order by case when countries = 'Land Of The Free' then 0 else 1 end,
countries[/code]

e4 d5 xd5 Nf6
Go to Top of Page

jsmith123
Starting Member

2 Posts

Posted - 2007-10-09 : 11:48:40
Thanks
Go to Top of Page
   

- Advertisement -