Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不是ASC或DESC....按自定义订购...
ASC
DESC
我试过使用case但没有成功
case
SELECT * FROM Customers ORDER BY case country when 'P' then 1 …
这就是我要的:
SELECT * FROM Customers ORDER BY case when country = 'P' then 1 when country = 'A' then 2 when country = 'L' then 3 when country = 'H' then 4 else 5 end asc