当前位置: 代码迷 >> SQL >> sql递归查询全部子集
  详细解决方案

sql递归查询全部子集

热度:92   发布时间:2016-05-05 13:16:54.0
sql递归查询所有子集

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



?


  相关解决方案