有一个自反表,两个字段id,pId--父ID,无限分级,输入一个ID能得到这个ID下面所有子集的ID
;with wsp as
(
select * from mt_community_seat_tbl where id=38182
union all
select a.* from mt_community_seat_tbl a,wsp b where a.seat_Parent_Id=b.id
)
select id from wsp
有一个自反表,两个字段id,pId--父ID,无限分级,输入一个ID能得到这个ID下面所有子集的ID
;with wsp as
(
select * from mt_community_seat_tbl where id=38182
union all
select a.* from mt_community_seat_tbl a,wsp b where a.seat_Parent_Id=b.id
)
select id from wsp