这是 A 表 id 对应 name
现在要统计 b 表内 不同 id 出现的次数,并以 name 展示也就是最后结果应该是 这样的
收起
select a.name,count(*) 次数 from A a join B b on a.id=b.id group by a.name
报告相同问题?