有两张表
table_a   id(KEY),name
table_b   id(KEY),a_id,name
如何查找table_a的所有字段,以及每一个table_a中id的对应table_b中记录的条数
查找结果如:
table_a.id,table_b.name,count(table_b.*)
   1          苹果           5
   2          香蕉           6
谢谢!!
我写了个sql不对,贴出来:
select table_a.* , count(table_b.id) from table_a,table_b where table_a.id = table_b.a_id