Top Earners

  • + 0 comments
    
    SELECT 
        CONCAT(max_val.max_earnings, ' ', COUNT(*)) AS result
    FROM employee e
    JOIN (
        SELECT MAX(months * salary) AS max_earnings
        FROM employee
    ) AS max_val ON e.months * e.salary = max_val.max_earnings
    GROUP BY max_val.max_earnings;