递归
2008可以在帮助文档搜索CTE
with cte as
(
select PraentID from tb where id=@id
union all
select a.PraentID from tb a join cte b on a.ID=b.PraentID where PraentID is not null
)
select * from cte
递归
2008可以在帮助文档搜索CTE
with cte as
(
select PraentID from tb where id=@id
union all
select a.PraentID from tb a join cte b on a.ID=b.PraentID where PraentID is not null
)
select * from cte