标签:
drop table #cont
select a,b,count(a) as cut
into #cont
from test
group by a,b
order by a,bcount(a) desc
select * from #cont cont1 where cont1.b in(select top 3 b from #cont cont2 where cont2.a=cont1.a )
标签:
原文地址:http://www.cnblogs.com/xxzkj/p/4673798.html