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

Consistency level in Azure cosmos db

 Consistency level in Azure cosmos db Azure Cosmos DB offers five well-defined consistency levels to provide developers with the flexibility...