Top Earners

Sort by

recency

|

3545 Discussions

|

  • + 1 comment

    MySQL Code:

    SELECT (months * salary) AS EARNINGS, COUNT(*) FROM EMPLOYEE GROUP BY EARNINGS ORDER BY EARNINGS DESC LIMIT 1
    
  • + 0 comments

    Another solution using sub-Query not lisited in discussions

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

  • + 0 comments
    SELECT salary*months, COUNT(*)
    FROM employee
    GROUP BY salary*months
    ORDER BY salary*months DESC
    LIMIT 1
    
  • + 0 comments

    SELECT concat(max(salary*months),' ',count(*)) from employee group by salary*months order by salary*months desc limit 1;

  • + 0 comments

    SELECT (months*salary)as total_sal,count(*)as cnt from employee group by 1 order by 1 desc limit 1