Sqlserver中with的简单用法
Sqlserver中with的简单用法
以下示例是为实现递归效果的SQL
with Tree as
(
select * from T_Function
where FunctionId = 1
union all
select T_Function.* from Tree, T_Function
where
Tree.FunctionId = T_Function.fatherid
)
select *
from Tree
浙公网安备 33010602011771号