Om de hele rij met de maximale waarde te krijgen, kunt u ORDER BY ... DESC LIMIT 1
gebruiken in plaats van MAX
:
SELECT company_name, cnt
FROM (
SELECT company_name, count(employee_name) AS cnt
FROM works
GROUP BY company_name
) w1
ORDER BY cnt DESC
LIMIT 1