Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: invalid sql for query with groupby aggregate pushdown, projecting Lenght property on top of that #12577

Closed
maumar opened this issue Jul 6, 2018 · 1 comment

Comments

@maumar
Copy link
Contributor

maumar commented Jul 6, 2018

query:

                var query = ctx.Orders.GroupBy(e => e.CustomerID)
                        .Where(g => g.Count() > 10)
                        .Select(g => g.Key)
                        .OrderBy(t => t)
                        .Take(20)
                        .Skip(4)
                        .Select(e => e.Length);

                var result = query.ToList();

generated sql:

SELECT [t].[c]
FROM (
    SELECT TOP(@__p_0) CAST(LEN([e].[CustomerID] AS [Key]) AS int) AS [c], [e].[CustomerID] AS [Key]
    FROM [Orders] AS [e]
    GROUP BY [e].[CustomerID]
    HAVING COUNT(*) > 10
    ORDER BY [c0]
) AS [t]
ORDER BY [t].[Key]
OFFSET @__p_1 ROWS
@ajcvickers ajcvickers added this to the 2.2.0 milestone Jul 6, 2018
@smitpatel
Copy link
Member

Duplicate of #12826

@smitpatel smitpatel marked this as a duplicate of #12826 Jul 27, 2018
@smitpatel smitpatel removed this from the 2.2.0 milestone Jul 27, 2018
@smitpatel smitpatel removed their assignment Jul 27, 2018
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants