摘要:
父类组织机构中查询出所有子类下的用户: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 阅读全文