I have take the Theme Database as the sample
var ThemeDetailsLastUpdated = from r in dc.ThemeDetails
group r by r.ThemeID into rg
select new { ThemeID = rg.Key, DatedOn = rg.Max(p => p.DatedOn) };
the above code will get the max of last updated, with that we are going to self join
var ThemeDetailSelfJoin = from td in dc.ThemeDetails
join tdu in ThemeDetailsLastUpdated on
new { td.ThemeID, td.DatedOn } equals new { tdu.ThemeID, tdu.DatedOn }
select new { td.ThemeID };