Top Earners

  • + 1 comment

    For ORACLE junkies : select salary*months,count(*) from employee where salary*months = (select max(salary*months) from employee) group by salary*months;

    This will work faster then using the Having Condition.

    Initially I tried using - select salary*months,count(*) from employee group by salary*months having salary*months = (select max(salary*months) from employee);

    But in this case the query cost was damn too high because of obvious reasons.