with w as --w 为一张临时表
(
select DID,DName,PID from Storage_Depository where DID='A'
union all
select A.DID,A.DName,A.PID from Storage_Depository A,w B where A.PID=B.DID
)
select * from w
在sql server中利用with as实现递归功能
最新推荐文章于 2019-07-02 16:42:02 发布