试试看,可以不
select a.id,b.name,a.name as name2,(select count(*) from table1 where fatherid=a.id) from table2 a left join table1 b on b.id=a.id