I have one table like this.
Age Group
20 G1
21 G2
20 G2
21 G1
22 G3
21 G1
20 G2
21 G2
22 G3
20 G1
22 G3
The result I want is
Age Grp Count
20 G1 2
20 G2 2
21 G1 2
22 G2 2
22 G3 3
I can’t figure it out how to calculate by 2 group by
I have only 1 group by
var thirdResultQuery=from row in secondResultQuery
group row by new {row.Grp } into g
select new
{
g.Key.Grp,
ageCount = g.Count()
};
Any idea?
add
Agein theGROUP