Skip to content
Advertisement

How can I group a joined query with linq

I’m trying to produce a data set for a graph that would get me the same result as the following SQL query:

But if I try to translate it into a linq query, I can’t get the same result, I either don’t have access to one or the other side of the junction, or I get a yearly total of one or the other side.

I tried to nest another linq query in the Collected column but then I would get the yearly amount on each month (g.Key).

Advertisement

Answer

This query should work. You have to include into grouping more items. Also I have optimized your query do group by two fields, not a concatenation.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement