关于Oracle的查询条件的自定义顺序

select EMP_ID from org_employee where useraccounts in ('xxx6530','xxx1527','xxx0323','xxx2718')
and userIsDeleted=0 and USERISACTIVE=1 order by INSTR('xxx6530,xxx1527,xxx0323,xxx2718',useraccounts);

如果不加 order by INSTR('xxx6530,xxx1527,xxx0323,xxx2718',useraccounts);查询的结果就没有顺序了

 

posted @ 2021-11-02 15:18  向上丶  阅读(117)  评论(0编辑  收藏  举报