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 子集
sql server递归
Easter79
2021-10-12
1018 1 0
点赞
收藏
评论区
加载中...