mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Group by with alias not working with Oracle db #5727
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 @manfredjb on GitHub (Oct 4, 2017).
Originally assigned to: @lcobucci on GitHub.
In MySQL, this query run correctly:
MySQL accepts alias in
orderandgroup byclauses. However, the same query is not valid in Oracle 10g, 11g (tested cases):In order to get it working, you must call
substrin the clause too:Said that, in doctrine this is only valid for MySQL:
And this (expected syntax for Oracle) display an error that all of us know:
I know that using native query is a workaround, but could be good to make it works in query builder for Oracle vendor too. I would like to know your comments about. Thank you in advance.
@lcobucci commented on GitHub (Nov 26, 2017):
@manfredjb I'm sorry but I think that the ORM shouldn't handle platform-specific things. To be honest I'd say that you could use the DBAL connection directly because you don't even need the ORM stuff to build this query (your desired result set contains only one column and not the entity).
@lcobucci commented on GitHub (Nov 26, 2017):
I'll close this as
Won't fixdue to given explanation, please re-open if you feel the need of discussing it further.