Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2852

Enclose subquery with parenthesis in from clause (QueryBuilder)

    Details

      Description

      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.

        Activity

        Hide
        Christophe Coevoet added a comment -

        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

        Show
        Christophe Coevoet added a comment - 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

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Matthieu Pécro
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: