1with cte as 2( 3select belongsAgent from [QPProxyDB].[dbo].[BS_ProxyInfo] where ProxyID = @ProxyID 4union all 5select a.ProxyID from [QPProxyDB].[dbo].[BS_ProxyInfo] a join cte b on a.ProxyID = b.belongsAgent 6) 7select * from cte order by belongsAgent asc 8 9ProxyID 父级 10 11belongsAgent 子集
sql server递归
Easter79
2021-10-12
1019 1 0
点赞
收藏
评论区
加载中...