有这样一个请求:
SELECT name, MAX(SkillsCount)
FROM (SELECT Users.name, Users.id, COUNT(Skills.SkillName) as SkillsCount
FROM Users join Skills on Users.id == Skills.id
GROUP BY Users.id)
但是,它只输出一个值,虽然有几个值具有相同的 SkillsCount (5)
有这样一个请求:
SELECT name, MAX(SkillsCount)
FROM (SELECT Users.name, Users.id, COUNT(Skills.SkillName) as SkillsCount
FROM Users join Skills on Users.id == Skills.id
GROUP BY Users.id)
但是,它只输出一个值,虽然有几个值具有相同的 SkillsCount (5)
像这样的东西:
但是为了在大型表上获得不错的性能,您必须进行修补。