我有一张包含国家/地区的表格:
Countries
============
Australia
South Africa
Bangladesh
New zeland
Sri Lanka
England
...
Desired out put is
Country
===========
India
Sri Lanka
Followed by other countries in `Asc` or `Desc`
答案 0 :(得分:2)
您可以使用CASE
:
<强> SqlFiddleDemo 强>
SELECT *
FROM Countries
ORDER BY
CASE Name
WHEN 'India' THEN 0
WHEN 'Sri Lanka' THEN 1
ELSE 10
END ASC,
Name ASC -- DESC