Tuesday, June 7, 2016

SQL Server max , count



with ct as (
select count(*) as dt from employee
where months*salary = (
    select max(months*salary)
             from employee ) )
   
select A.*,B.* from
( select max(months*salary) as x
             from employee ) as A, ct as B;

No comments:

Post a Comment