Display values of column 2 after column 1

时间:2016-04-04 16:44:26

标签: sql

I have a table COUNTRIES. I want a particular country to be displayed on the top and the rest of the countries to be displayed alphabetically. For example my expectation is :

India -- to be displayed always on top Afghanistan Bulgaria Canada Denmark Zambia

1 个答案:

答案 0 :(得分:0)

You can do this by putting conditional expressions in the order by:

order by (case when countryname = 'India' then 1 else 2 end),
         countryname
相关问题