摘要: 父类组织机构中查询出所有子类下的用户:WITH TEMPLEORZ(DeptID, ParentId,DeptName) AS ( SELECT DeptID, ParentId,DeptName FROM dbo.tp_com_dept WHERE DeptID=3 UNION ALL SELECT ORZ.DeptID,ORZ.ParentId,ORZ.DeptName FROM dbo.tp_com_dept AS ORZ,TEMPLEORZ AS TORZ WHERE ORZ.ParentId = TORZ.DeptID ) select UserID ,UserName ,TrueN 阅读全文
posted @ 2013-03-21 15:14 求知的我 阅读(216) 评论(0) 推荐(0) 编辑