SQL Server 查詢樹結構的表,查詢一個節點的所有子節點


1 ;with cte as 
2 (
3     select * from Associator where No = 'mc1007'
4     union all
5     select air.* from Associator as air inner join cte on air.ParentNo = cte.No
6 )
7 select * from cte;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM