with nodes as
(
SELECT * from tableA
WHERE ID = '8bc73182-0a8c-4b7b-8916-2dc5c74afd60' --当前节点id
UNION all
SELECT a.* from tableA as a
INNER join nodes as b
ON a.ParentId = b.ID
)
SELECT * from nodes
with nodes as
(
SELECT * from tableA
WHERE ID = '8bc73182-0a8c-4b7b-8916-2dc5c74afd60' --当前节点id
UNION all
SELECT a.* from tableA as a
INNER join nodes as b
ON a.ParentId = b.ID
)
SELECT * from nodes