SQL SERVER WTIH AS
with resultas
(
select id, parentid,name from syst_dept where id = 'b649a10a3fa8017b003165fea703fa81'
union all
select a.id,a.parentid,a.name from syst_dept a join result b on
-- b.parentid = a.id-- 向上查询
a.parentid = b.id--向下查询
)
select * from result
页:
[1]