答案 0 :(得分:0)
SELECT RoleName, count(*) as NumberOf
FROM Roles
WHERE RoleName = ‘Administrators’;
或者,更加通用和计算每个RoleName的数量
SELECT RoleName, count(*) as NumberOf
FROM Roles
GROUP BY RoleName
答案 1 :(得分:0)
您可以尝试这样的查询
SELECT
r.RoleName,
COUNT(UR.Userid)
FROM Roles R
JOIN UserRole UR
ON R.RoleId = UR.RoleId
GROUP BY r.RoleName