Top Earners

  • + 0 comments

    SELECT salary * months, COUNT(employee_id) -- count of total earnings, count of total employees. FROM Employee GROUP BY salary * months -- to select the group of total earnings ORDER BY salary * months DESC LIMIT 1; -- ordering it by specifying the output to only First row after sorting.