mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2852: Enclose subquery with parenthesis in from clause (QueryBuilder) #3560
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 @doctrinebot on GitHub (Dec 12, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user houpli:
Hi
In QueryBuilder from clause, when argument is a QueryBuilder (not a string like a table), there are not parenthesis enclosure on the subquery.
Ex:
$subqb->select('myfield')->from('mytable');
$qb->from($sub, 'myalias)
DQL is : SELECT myfield FROM SELECT myField FROM mytable myalias. This is not working on MySQL.
It should be : SELECT myfield FROM (SELECT myField FROM mytable) myalias.
@doctrinebot commented on GitHub (Dec 12, 2013):
Comment created by stof:
I don't understand your statement
This is not working on MySQL.after giving a DQL statement. MySQL does not support any DQL. It runs SQL.And DQL does not support using a subselect in the FROM clause