group by 功能为分组,分组后可用于统计使用
查询子类个数,可通过自连接实现
select a.id,count(*) as children_num from test as a left join test as b on a.id = b.parent_id
group by a.id