Top Earners

  • + 1 comment

    MS SQL Server:

    with abc as (select name,(months*salary) as earnings from employee),

    def as (select earnings,count(name) as names from abc group by earnings)

    select top 1 * from def order by earnings desc