Suppose I have country data in unmannered way (not in sequence) in table tbl. Now I want to show Country 'United States','Canada' & 'India'
first & rest of the country shown in ascending order.
Country
India
China
Brazil
Azerbaijan
Bahamas
United State
Denmark
Canada
Now I want this data as :
Country
United State // US,Canada,India should be First 3.
Canada
India
Azerbaijan // After rest country comes in ascending Order.
Bahamas
Brazil
China
Denmark
Any suggestion really appreciate.
SELECT Country FROM tbl
ORDER BY CASE
WHEN Country='United State' THEN 0
WHEN Country='Canada' THEN 1
WHEN Country='India' THEN 2
ELSE 3
END, Country;