ORACLE SQL 分组

select max(cost),suppliercode from tel_bill where period = '2014005' group by suppliercode;
select * from (
select cost,telnum,suppliercode,period,row_number() over(partition by suppliercode order by cost desc ) rn
from tel_bill where period = '2014005'
) t where t.rn <=1

posted @ 2016-05-31 16:15  zfswff  阅读(311)  评论(0编辑  收藏  举报