LinQ递归查询

  --由父项递归下级
with cte(refid,pid,zname,code)
as
(--父项
select refid,pid,zname,code from zuzhi where pid =
union all
--递归结果集中的下级
select t.refid,t.pid,t.zname,t.code from zuzhi as t
inner join cte as c on t.pid = c.refid
)
select refid,pid,zname,code from cte
上一篇:C#如何分割多个空格分隔的字符串?


下一篇:javaScript基础之闭包