select board_id,(select count(*) from tbllists_old as B where parentid>0 and B.board_id=A.board_id) as CS1,(select count(*) from tbllists_old as B where parentid=0 and B.board_id=A.board_id) as CS2,(select count(*) from tbllists_old as B where datediff("d",a_date,now)<15 and b.board_id=A.board_id) as CT from tbllists_old as A group by board_id<br/><br/>以前N次查询的问题一个语句搞定。长知识了。