我希望在一个表上进行选择,并按某个关键字或关键字列表对结果进行排序。例如,我有一个像这样的表:
ID Code 1 Health 2 Freeze 3 Phone 4 Phone 5 Health 6 Hot
所以Order By asc/desc我不想做一个简单的事情order by Health, Phone, Freeze, Hot。这可能吗?
Order By asc/desc
order by Health, Phone, Freeze, Hot
尝试使用此:
select * from table order by FIELD(Code, 'Health', 'Phone', 'Freeze', 'Hot')