with myCte as
(
select * from RS_Comment where id=10000004
union all
select RS_Comment.* from RS_Comment
inner join myCte on RS_Comment.ParantID=myCte.id
)
select * from myCte
递归查询所有子集
时间: 2024-11-13 10:02:52
with myCte as
(
select * from RS_Comment where id=10000004
union all
select RS_Comment.* from RS_Comment
inner join myCte on RS_Comment.ParantID=myCte.id
)
select * from myCte
递归查询所有子集