摘要:
WITH cte AS ( SELECT Id,Pid,DeptName,0 AS lvl FROM Department WHERE Id = 2 UNION all SELECT d.Id,d.Pid,d.DeptName,lvl+1 FROM cte c inner join Department d ON c.Pid = d.Id ) SELECT... 阅读全文
posted @ 2016-03-29 14:08 shenyixin 阅读(166) 评论(0) 推荐(0) 编辑