Bug #57186 | Linq query fails when selecting both the key and an aggregate from a grouping | ||
---|---|---|---|
Submitted: | 1 Oct 2010 21:40 | Modified: | 25 Oct 2010 6:49 |
Reporter: | Jason Day | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.3.4 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | GROUP BY |
[1 Oct 2010 21:40]
Jason Day
[25 Oct 2010 6:49]
Tonci Grgin
This is a duplicate of Bug#46742.
[16 Nov 2010 6:55]
Whikiey Yan
I got the same problem, and i got a temp way to resolve it. Change "g.Key" to "g.FirstOrDefault().ColumnGroupBy"
[16 Nov 2010 7:05]
Whikiey Yan
and we can not use a subscript in group by clause example: // t2 is a subtable of t1 var counts = from t1 in t1entities group gt1 by t1.c1 select new { C1 = gt1.FirstOrDefault().c1, Count = gt1.Where(t1 => t1.t2s.Any(t2=>t2.c2 == 0)).Count()}; it will also cause an "Unknown column" exception, so please FIX this, many thanks.