56,678
社区成员
发帖
与我相关
我的任务
分享
select a.SPID, count(b.SPCOUNT) as cnt
from tableA as a
inner join tableB as b on a.SPID = b.SPID
group by a.SPID
order by cnt desc
select a.SPID, cnt = count(b.SPCOUNT)
from tableA as a
inner join tableB as b on a.SPID = b.SPID
group by a.SPID
order by cnt desc