Need to modify the below sql query to linq to entities.
SELECT a.*, c.*
FROM bp_user a
INNER JOIN bp_audit_logintime c
ON a.UserName = c.User_Name
INNER JOIN
(
SELECT User_Name, MAX(Login_Time) maxDate
FROM bp_audit_logintime
GROUP BY User_Name
) b ON c.User_Name = b.User_Name AND
c.Login_Time = b.maxDate
we got struck near Inner Join with select sub query......Please help
Jaganathan BantheswaranPosted Nov 13, 2013, 2:49 AM
var data = from a in bp_user
join c in bp_audit_logintime on a.UserName = c.User_Name
join b in (from x in bp_audit_logintime group x by x.User_Name into g select new bp_audit_logintime { User_Name = g.Key, maxDate = g.Max(m => m.Login_Time) } ) on c.User_Name = b.User_Name AND
c.Login_Time = b.maxDate