sql server递归
程序员文章站
2022-10-20 17:14:57
with cte as ( select belongsAgent from [QPProxyDB].[dbo].[BS_ProxyInfo] where ProxyID = @ProxyID union all select a.ProxyID from [QPProxyDB].[dbo].[BS... ......
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
上一篇: 看师傅开个锁,看得我都湿了