日期:2014-05-16 浏览次数:20422 次
select a.id_item as id_item,a.operatenum as operateid,nvl(b.operatenum1,0) as operatenum1,nvl(c.operatenum2,0) as operatenum2 from(select id_item,count(operateid) as operatenum from stm_expapprove where operateid='OPER000001' group by(id_item) order by operatenum desc)a left join (select id_item,count(operateid) as operatenum1 from stm_expapprove where operateid='OPER000002' group by(id_item) order by operatenum1 desc)b on a.id_item=b.id_item left join (select id_item,count(operateid) as operatenum2 from stm_expapprove where operateid='OPER000003' group by(id_item) order by operatenum2 desc)c on b.id_item=c.id_item order by operateid desc,operatenum1 desc,operatenum2 desc