首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

oracle select where in 排序,运用聚合函数排序

2012-09-03 
oracle select where in 排序,使用聚合函数排序select a.commo_no,sum(b.charge)from sale_comm a,sale_ma

oracle select where in 排序,使用聚合函数排序
select a.commo_no,sum(b.charge)
from sale_comm a,sale_master b
where a.exchange_no=b.exchange_no
and a.commo_no in (1000003916,1000019634,1000059906,1000028100,1000026625,1000026632,1000054970)
group by a.commo_no

列出来的数据要按照in后面的顺序排列,怎么搞?
谢谢。
如果in后面的数据都是字符串型号的,就是加单引号的,又怎么做?


[解决办法]
order by instr('1000003916,1000019634,1000059906,1000028100,1000026625,1000026632,1000054970',a.commo_no)

热点排行
Bad Request.