-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Wrong SQL generation with group by and Count() in EF Core 2.1 Preview 1 #11322
Labels
Comments
Generated SQL in nightly build SELECT [p].[Departure] AS [City], COUNT(*) AS [Count]
FROM [FlightSet] AS [p]
GROUP BY [p].[Departure]
HAVING COUNT(*) > 5
ORDER BY [Count] Duplicate of #10870 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In EF Core 2.1 Preview 1, this query
produces this SQL
which is wrong.
Exception:
System.Data.SqlClient.SqlException: 'An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.'
Further technical details
EF Core version: 2.1.0-preview1-final
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 1703
SQL Server: 2017
IDE: Visual Studio 2017 15.6.1
The text was updated successfully, but these errors were encountered: