Top Earners

Sort by

recency

|

3180 Discussions

|

  • + 0 comments

    select CONCAT(max(months*salary),' ',count(*)) from employee where months*salary = (select max(salary*months) from employee);

    FOR MYSQL

  • + 0 comments

    ;With CTE (employee_id,Earning) As (SELECT employee_id, Salary * Months FROM Employee ) SELECT CAST(Earning as Varchar(100)) + ' ' + CAST(Count(*) as Varchar(10)) FROM CTE WHERE Earning in (SELECT Max(Earning) FROM CTE) GROUP BY Earning;

  • + 0 comments

    select max(salary*months)||' '||count(employee_id) from employee where (salary*months) = (select max(salary*months) from employee);

  • + 0 comments

    select top 1 salary * months, count(*) from employee group by salary * months order by salary * months desc

  • + 0 comments

    This worked for me. SELECT MAX(salary * months) AS max_earnings, COUNT(*) AS count_of_employees_with_max_earnings FROM Employee WHERE (salary * months) = (SELECT MAX(salary * months) FROM Employee);