Click here to Skip to main content
16,013,918 members

Comments by Pavan Kumar Chiluveru (Top 3 by date)

Pavan Kumar Chiluveru 4-May-17 7:14am View    
You can also query like this :

select top(1) name,dept,sum(salary) as sal from employee group by name,dept order by sal desc

Try to check this once



Pavan Kumar Chiluveru 4-May-17 6:03am View    
ok..try this

select name,sum(salary)as total,dept from employee where name='john' group by dept,name

It will give exact details
Pavan Kumar Chiluveru 4-May-17 5:49am View    
after summation it gives the maximum salary from the table