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

原文地址:https://www.cnblogs.com/zfswff/p/5546254.html