Oracle根据查询条件 in 里的参数顺序排序
1、表内容
2、普通查询结果
select * from Test t where t.name in (‘33’,‘22’,‘44’,‘55’);
3、按in排序的结果
select * from Test t where t.name in (‘33’,‘22’,‘44’,‘55’) order by instr(‘33224455’,t.name) ;
用法
instr(‘originStr’ , ‘targetStr’ , index , count);
简单说明
originStr:要匹配的源字符
targetStr:要匹配的目标字符
index:从第几个开始匹配
count:匹配第几次
返回:如果匹配到返回目标字符在源字符的下标位置,不匹配返回-1