sql server递归
文章目录
with cte as
(
select belongsAgent from [QPProxyDB].[dbo].[BS_ProxyInfo] where ProxyID = @ProxyID
union all
select a.ProxyID from [QPProxyDB].[dbo].[BS_ProxyInfo] a join cte b on a.ProxyID = b.belongsAgent
)
select * from cte order by belongsAgent asc
ProxyID 父级
belongsAgent 子集
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论