ORACLE sql 根据in查询里面数据的顺序进行排序 ORDER BY 自定义结果排序查询

select t.* from user_objects t WHERE t.object_type IN('TABLE','SEQUENCE','VIEW','PACKAGE','PACKAGE BODY','FUNCTION')
ORDER BY case t.object_type
when 'TABLE' then 1
when 'SEQUENCE' then 2
when 'VIEW' then 3
when 'PACKAGE' then 4
when 'PACKAGE BODY' then 5
when 'FUNCTION'then 6 ELSE 0 END

猜你喜欢

转载自blog.csdn.net/lq491040758/article/details/78190125