今天有人问,写了一个,贴出来也许有人能用上,不过这个语句是查询所有portal下的Administrator
1: SELECT u.*
2: FROM {databaseOwner}[{objectQualifier}Users] as u JOIN (
3: SELECT u.UserID
4: FROM {databaseOwner}[{objectQualifier}Roles] AS r JOIN {databaseOwner}[{objectQualifier}UserRoles] AS u
5: ON r.RoleID = u.RoleID
6: WHERE r.RoleName = 'Administrators'
7: ) AS r
8: ON u.UserID = r.UserID