Top Earners

  • + 0 comments
    with totale as(
        select employee_id, (salary*months) as total_earning
        from employee
    )
    select max(total_earning), count(employee_id)
    from totale
    where total_earning =(
        SELECT MAX(total_earning)
        FROM totale
    );