Top Earners

Sort by

recency

|

3501 Discussions

|

  • + 0 comments

    MS SQL

    SELECT max(salary*months), count(*) from employee where (salary*months) = (SELECT max(salary*months) from employee);

  • + 0 comments

    select (salary*months) as q, count(employee_id) from employee group by q DESC limit 1

  • + 0 comments

    WITH total_Earn AS ( SELECT employee_id, salary * months AS totalEarning FROM Employee ) SELECT concat(MAX(totalEarning),' ',COUNT(employee_id)) FROM total_Earn WHERE totalEarning = (SELECT MAX(totalEarning) FROM total_Earn);

  • + 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.

  • + 0 comments

    SELECT CONCAT(MAX(months*salary), ' ', COUNT(*)) FROM EMPLOYEE WHERE (months*salary)=(SELECT MAX(months*salary) FROM EMPLOYEE);