谢谢,我找到答案了。 你看看对吗?
一级子集:select * from table where parentId=5
二级子集:select * from table where parentId in(select id from table where parentId=5)
三级子集:select * from table where parentId in(select id from table where parentId in(select id from table where parentId=5))