标签:sde role code info left join HERE data erro XML
SELECT users.UserID AS Id, users.UserName, users.TrueName, users.Phone, users.Email, STUFF( ( SELECT ‘,‘ + roles.Description FROM Accounts_UserRoles userroles LEFT JOIN Accounts_Roles roles ON roles.RoleID = userroles.RoleID WHERE userroles.UserID = users.UserID FOR XML PATH(‘‘) ), 1, 1, ‘‘ ) AS RoleNames, ( SELECT TOP 1 UserName FROM Accounts_Users sup WHERE sup.UserID = users.SuperiorId AND users.SuperiorId IS NOT NULL ) AS SuperiorName, users.Activity, users.IsSuperior, users.DataRange, dept.DeptName FROM Accounts_Users users LEFT JOIN DeptInfo dept ON dept.DeptId = users.DeptID AND dept.DelFlag = 0 WHERE users.IsDelete = 0 AND users.ClientCode IS NULL;
标签:sde role code info left join HERE data erro XML
原文地址:https://www.cnblogs.com/shy1766IT/p/13279067.html