| Bug #58218 | "Key" groupped by cannot be used in linq2e, group by subquery cannot be executed | ||
|---|---|---|---|
| Submitted: | 16 Nov 2010 7:23 | Modified: | 16 Nov 2010 7:29 |
| Reporter: | Whikiey Yan | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | Connector / NET | Severity: | S1 (Critical) |
| Version: | 6.3.4 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | GROUP BY | ||
[16 Nov 2010 7:29]
Tonci Grgin
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the original bug instead. Thank you for your interest in MySQL. Explanation: This is a duplicate of Bug#46742.

Description: 1. the "Key" in group by can not be selected in a linq query. example: var counts = from t1 in t1_entities group gt1 by t1.c1 select new { C1 = gt1.Key, Count = gt1.Count() }; it will cause an "Unknown column" exception. 2. and we can not use a subscript in group by clause example: // t2 is a subtable of t1 var counts = from t1 in t1_entities 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. please fix these 2 issues, many thanks. How to repeat: always