This blog is created to be able to help software developers searching specific information.
Wednesday, June 6, 2012
LINQ group by Count and Avarage/avg
var query = from q in this.context.TRAINING_PLAYER
group q by q.session_id into grp
select new
{
sessionId = grp.Key,
count = grp.Select(p => p.player_id).Distinct().Count()
};
No comments:
Post a Comment