mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
MSSQL Doesn't support grouping by an aliased variable #4946
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gnat42 on GitHub (Dec 18, 2015).
The following SQL is invalid for SQL SRV.
However this is valid
Unfortunately due to #5561 you cannot write a DQL query like the above. Also because of that SQL difference queries now need to care about the platform unless doctrine would take the variable and substitute the calculation instead for SQL SRV.
@billschaller commented on GitHub (Dec 18, 2015):
You can use a named native query to accomplish this.
See http://docs.doctrine-project.org/en/latest/reference/native-sql.html#named-native-query