MYSQL递归查询
select id from (
select t1.id,
if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild
from (
select id,parent_id from category t where order by parent_id, id
) t1,
(select @pids := 10000001) t2
) t3 where ischild != 0;