发布网友 发布时间:2022-05-01 22:29
共2个回答
懂视网 时间:2022-05-02 02:50
用CTE递归;
with
f
as
(
select
*
from
tab
where
id=1
union
all
select
a.*
from
tab
as
a
inner
join
f
as
b
on
a.pid=b.id
)
select
*
from
f
SQLServer查询所有子节点
标签:lin 递归 index with union where 节点 number nbsp
热心网友 时间:2022-05-01 23:58
这个很好实现!就是添加和修改操作: