score:9
Accepted answer
from t in (
from h in accountquery
join u in ubuquery on h.compoundkey1.ucet equals u.ucet
select new {h,u}
) group t by new {t.h.compoundkey1.ucet} into g
select new {
ucet = g.key.ucet,
md = g.sum(k => k.h.md),
dal = g.sum(k => k.h.dal),
md_m = g.sum(k => k.h.mdm),
dal_m = g.sum(k => k.h.dalm),
kod = g.max(k => k.u.kod)
};
Source: stackoverflow.com
Related Query
- Linq group by on multiple table and inner join
- LINQ Group By multiple table Inner Join and aggregate function
- C# Linq Join 2 tables on multiple columns and GROUP BY for count
- How to group table data and sum by multiple columns using LINQ or another approach
- Multiple Join and Group By LINQ
- LINQ Group by on multiple tables with nested group by with join and aggregate
- LINQ inner join betwenn Enumerable and DB Table
- Linq group by multiple columns and getting extra values from table before group by clause
- Get result with inner join and group by in LINQ
- LINQ: join multiple Table Column using Linq and find aggregated sum from child table values
- LINQ Left Outer Join Multiple Tables with Group Count and Row Concatenation
- How to group by with left join by multiple columns using linq and get count of grouped records?
- SQL to C# LINQ query with multiple group by inner queries and having clauses
- Join 2 table and group 2 field in linq
- LinQ with multiple joins, left join with where clause, and group by
- Multiple Left Join and Inner Join with LinQ
- SQL to LINQ - Multiple Group By Statements and a Join
- convert SQL query with multiple join on multiple tables using group by on multiple columns and with aggregate function into LINQ
- Multi Table join and group by in Linq
- Using LINQ to group by multiple properties and sum
- Multiple group by and Sum LINQ
- Linq to Entity Join table with multiple OR conditions
- LINQ TO DataSet: Multiple group by on a data table
- LINQ Join with multiple AND conditions
- Linq query join one table row to another table multiple row
- Linq to Entity Join and Group By
- Multiple Select and Join with LINQ and Lambda
- linq query to join two tables and get the count from one table values from the other
- LINQ join and group
- LINQ Method Syntax with INNER and OUTER Join
More Query from same tag
- Group By that chains back and forth across two fields
- Using linq with a PropertyInfo
- Returning list of count and grouped by id linq to sql
- randomize Select do not work
- Computed Columns in EF using LINQ
- How to get only the date value from DateTime and count it?
- Find max object field value in List
- How to generate BlToolkit model
- Find all matches in a List LinQ
- Filtering Data Table based on column values containing special charactors in asp.net c#
- Accessing List<BaseClass> by specifying derived class
- Why the same LINQ expression behaves differently in two different foreach loops?
- Accessing class data from another window
- String to LINQ expression?
- LINQ Lambda - Find all ID's in one list that don't exist in another list
- Doing multiple joins within a LINQ statement
- Are these improper ways of using LINQ?
- How to successfully join two in-memory linq collections?
- Linq query throws NullReferenceException when pulling data from SQLite, why?
- LINQ Entities Where clause not in correct place
- ASP.NET ReportViewer and Linq To Sql Questions
- Generate a list holding/making mapping between a List<string> and a List<int>
- Find object with in class using LINQ
- Count word occurrences in a text field with LINQ
- cal-heatmap data from linq query
- Why is Linq that slow (see provided examples)
- Reference to a property of class in predicate using reflection
- LINQ Select and Group By
- changing sql JOIN Syntax to LINQ
- How do you convert a List of object to a one dimensional array?