当前位置:Gxlcms > 数据库问题 > sql 找到前三

sql 找到前三

时间:2021-07-01 10:21:17 帮助过:3人阅读

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 )

sql 找到前三

标签:

人气教程排行