We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Wednesday, December 27, 2017

Query example

We have tow tables Employee and Department, Now we have a question to find the max salary according to department location.

Description

I created a two table like below

Employee table



Dummy Data



Department table


Dummy Data



Now SQL query using join

select Department.Location,MAX(Salary) as Salary from Employee left join Department on Employee.DeptId=Department.DeptId group by Department.Location


Output



No comments: