《SQL 进阶教程》 case:练习题1-1-3 用 ORDER BY 指定顺序进行排序
select name
from greatests
ORDER BY
case
when name ='B' then 1
when name ='A' then 2
when name ='D' then 3
when name ='C' then 4
else 5
end
select name
from greatests
ORDER BY
case
when name ='B' then 1
when name ='A' then 2
when name ='D' then 3
when name ='C' then 4
else 5
end