Click here to Skip to main content
15,891,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am binding contry dropdownlis from database,i want to display india as a first item remaining country name I need display in ascending order using sql query
Posted
Updated 23-Nov-13 4:54am
v2

Select Country_Name From CountryTable where Country_Name='India'
union all
Select Country_Name from CountryTable where Country_Name<>'India'
 
Share this answer
 
In order to request items form SQL in a specif order, you need to have a column on which it can sort: a DisplayOrder column for example.
Country   DisplayOrder
USA            2
France         3
India          1
You can then use an SQL query to decide which order to display them in:
SQL
SELECT Country FROM MyTable ORDER BY DisplayOrder ASC
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900