SQL Server公用表達式CET遞歸查詢所有上級數據

with cte as(
select bianma,fjbm from #tree where chkDisabled='true'
union all 
select t.bianma,t.fjbm from cte c inner join #tree t on c.fjbm=t.bianma
)
select * from cte;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章