Hi
You can use the following query. As there are 2 tables Departments and Employees
using(var context =new dbContext(Your contextName))
{
var result = from dept in context.tblDepartments
group dept by dept.V_DEP_Name into dept1
join emp in context.tblemployees on dept1.FirstOrDefault().I_DEPT_ID equals emp.I_DEPT_ID
select new
{
TotalSalary = dept1.sum(p=>p.salary),
DepartName = dept1.FirstOrDefault(p=>p.V_DEP_Name)
}
}
I have given you the example. Here you can make change in the query as column in tables.