sql递归查询所有子集
select * from bg_organization

with a as(
select * from bg_organization where orgid=1
union all
select x.* from bg_organization x,a
where x.pid=a.orgid)
select * from a

sql递归查询所有子集
select * from bg_organization

with a as(
select * from bg_organization where orgid=1
union all
select x.* from bg_organization x,a
where x.pid=a.orgid)
select * from a

433

被折叠的 条评论
为什么被折叠?