如何让SQL语句不执行默认排序,而是按照in语句的顺序返回结果
Oracle:
select name from order where order_id in('111','222','333','444','555','666')order by instr('111,222,333,444,555,666',order_id);
Mysql:
select name from order where order_id in ('111','222','333','444','555','666') order by instr(',111,222,333,444,555,666,',CONCAT(',',order_id,','));
摘自:https://blog.****.net/u011884440/article/details/70510805