Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Krummelz/6376008 to your computer and use it in GitHub Desktop.
Save Krummelz/6376008 to your computer and use it in GitHub Desktop.
from p in PersonOrders
// put your where clause here
group p by p.PersonID into grp //could be grouped by anything, Grouping on Guid ID's is not a good idea
let MaxOrderDatePerPerson = grp.Max ( g=>g.OrderDate )
from p in grp
where p.OrderDate == MaxOrderDatePerPerson
select p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment