How do use join query of entities framework
there are two table in the sql,EmployeeCategory And EmployeeStatus, i want a join query that 1st check from employee category table employee category then from employeeStatus table the employee status, in employeestatus table there are multiple records against same employee ,i want to get last one.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Syed ShanuRank #87 · 23.7K reputationPosted Mar 18, 2015, 8:57 PM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 18, 2015, 9:00 PM EDT
select* from EmployeeCategory
left outer join
(select * from
(select Distinct * from EmployeeStatus)Temp)Red
on
EmployeeCategory.id=Red.id
in this query
(select Distinct * from EmployeeStatus)Temp will select distinct data from table and named as Temp. Now you can use join on this table with a name(Here i give a name 'Red')