Top Earners

  • + 0 comments
    select TOP 1
        MAX(total) as total,
        COUNT(*)
        from (
            select employee_id, name, salary * months AS total, months from Employee
        ) AS tabela
        GROUP BY total
        ORDER BY total desc