sqlserver 使用case when then 语句来实现
select name from fruit
order by case name
when 'Strawberry' then 1
when 'Banana' then 2
when 'Apple' then 3
else 4
end
oracle 使用decode实现
select * from table_example order by decode(class,'C',1,'A',2,'D',3,'B',4)
sqlserver 使用case when then 语句来实现
select name from fruit
order by case name
when 'Strawberry' then 1
when 'Banana' then 2
when 'Apple' then 3
else 4
end
oracle 使用decode实现
select * from table_example order by decode(class,'C',1,'A',2,'D',3,'B',4)