27,580
社区成员
发帖
与我相关
我的任务
分享
select a.名称,b.人数 from 社会团体 a,
(select 编号,count(*) '人数' from 参加 group by 编号) b
where a.编号=b.编号
cnt是人数
select 名称,人数 from 社会团体 a,
(select 编号,count(1)'人数' from 参加 group by 编号) b
where a.编号=b.编号
Select a.名称.b.人数 from 社会团体 a inner Join (Select top 1 编号,count(编号) as 人数 from 参加 group by 编号 order by 人数 desc) b on a.编号=b.编号
select 名称,cnt from 社会团体 a,
(select 编号,count(1)cnt from 参加 group by 编号) b
where a.编号=b.编号