Doctrine 1
  1. Doctrine 1
  2. DC-854

having not work as expected and described

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      $this->q1 = Doctrine_Query::create()
      ->select('m.questionaire')
      ->addSelect('m.aszero')
      ->addSelect('COUNT(f.id) as bref')
      ->from('machine m')
      ->leftJoin('m.relations r ON r.machine_id=m.id')
      ->leftJoin('r.ref f ON f.id=r.ref_id AND f.part_number LIKE "B%"')
      ->groupBy('m.questionaire')
      ->having('bref=0')
      ;
      is producing

      "SELECT m.id AS m_id, m.questionaire AS mquestionaire, m.aszero AS maszero, COUNT(r2.id) AS r2_0 FROM machine m LEFT JOIN relation r ON (r.machine_id = m.id) LEFT JOIN ref r2 ON ((r2.id = r.ref_id AND r2.part_number LIKE "B%")) GROUP BY m.questionaire HAVING bref=0 "

      but it should be

      "SELECT m.id AS m_id, m.questionaire AS mquestionaire, m.aszero AS maszero, COUNT(r2.id) AS r20 FROM machine m LEFT JOIN relation r ON (r.machine_id = m.id) LEFT JOIN ref r2 ON ((r2.id = r.ref_id AND r2.part_number LIKE "B%")) GROUP BY m.questionaire HAVING r2_0=0 "

      http://www.doctrine-project.org/docu mentation/manual/1_1/en/dql-doctrine-query-language%3Agroup-by,-having-clauses

      With kind regards

      Petronel

      I use symfony 1.4 and not sure if doctrine is 1...

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Petronel MALUTAN
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: