A表 id name
B表 aid
C表 cid
aid、bid都是对应A表id
现在想查询出表A的name和 bcount ccount的数量应该怎么写呢·
谢谢大家
select name from A
select count(*) from B
问题有歧义,
1 如果ID关联但是分别查B,C的 count可以分开查
2 如果是关联查询就应该说关联后的表中B,C的数量
select table_a.name ,table_b.count(*) from table_a A表,table_b B表 where table_a.id=table_b.aid