47

不是ASCDESC....按自定义订购...

我试过使用case但没有成功

SELECT * FROM Customers
ORDER BY case country
when 'P' then 1 …

这就是我要的:

4

1 回答 1

127
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
于 2013-10-05T10:09:41.760 回答