日期:2014-05-17 浏览次数:20790 次
with t as (
select 1 a,'a' b,1 c from dual union all
select 2 a,'b',5 from dual union all
select 3 a,'c',4 from dual union all
select 4 a,'a',3 from dual union all
select 5 a,'b',2 from dual
)
select a,b,c from (
select a,b,c,count(*)over(partition by b ) d from t where c>1
) order by d desc,c desc