select nb.*,nc.num from (select * from (select * from a order by createtime desc) as na group by parentid) as nb join (select b.id,count(*) as num from b join a on b.id=a.parentid group by b.id) as nc on nb.parentid=nc.id结果应为:
id name parentid createTime count[子类的总数]
3 atestd 1 2004-05-20 3
5 dfsdd 2 2004-05-25 2
id name parentid createTime count[子类的总数]
3 atestd 1 2004-05-20 3
5 dfsdd 2 2004-05-25 2
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货