日期:2014-05-20 浏览次数:20704 次
var query= from ec in db.EFContact
join ei in db.EFInquiry on ec.Id equals ei.ContactId
join sp in db.SysPerson on ec.DAPerson equals sp.Name
let tmp=db.EFInquiry.GroupBy(x=>x.ContactId).Select(g=>g.Max(x=>x.Id));
where tmp.Contains(ei.Id)
select ec;