9 September 2010

Query Getting the Maximum salary of the employee by department wise SUBQUERY Example

Query Getting the Maximum salary of the employee by department wise

SUBQUERY Example


select
E.fname +' '+ E.lname as EmpName
,T.Salary
,D.depname
,D.depid
from
Employenew E,
departnew D
,(select max(salary) as Salary ,depid from Employenew group by depid) as T
where
E.depid=D.depid
and T.depid=D.depid
and E.Salary =T.Salary

No comments:

Post a Comment

Comments Welcome

Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...