ORACLE sql 根据in查询里面数据的顺序进行排序

select rownum||‘‘ as id,t.materialname as prodCode,t.ename as prodName,t.materialtype||‘_‘||t.groupcode as kindName,
t.unit as unit,‘‘ as spec,‘‘ as price,t.materialcode as remark  
from material_master t where  t.materialcode in (‘101010006‘,‘101010007‘,‘101010009‘,‘101010020‘,‘101010024‘,‘101010025‘) 
order by case t.materialcode 
when ‘101010006‘ then 1 
when ‘101010007‘ then 2 
when ‘101010009‘ then 3 
when ‘101010020‘ then 4 
when ‘101010024‘ then 5 
when ‘101010025‘  end;

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。