码迷,mamicode.com
首页 > 数据库 > 详细

oracle按照in的顺序进行排序

时间:2014-12-07 22:58:32      阅读:482      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   sp   strong   on   div   log   bs   

oracle按照in的顺序进行排序

 

select * from table_name where id in (1,3,7)
order by case id
              when 1 then 1 
              when 3 then 2
              when 7 then 3 
         end;

oracle按照in的顺序进行排序

标签:style   blog   color   sp   strong   on   div   log   bs   

原文地址:http://www.cnblogs.com/gavinYang/p/4149905.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!