27,579
社区成员
发帖
与我相关
我的任务
分享
;with myT2 as(
select * from 表名 Where 根节点查询条件
union all
select 表名.* from myT2 inner join 表名 on myT2.ID=表名.ParentID)
select * from myT2
with myT3 as(
select * from 表名 Where 根节点查询条件
union all
select 表名.* from myT2 inner join 表名 on myT2.ID=表名.ParentID)
select * from myT3