Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Symfony 1.4
Description
$q1 = Doctrine_Query::create()
->select('m.questionaire, COUNT(f.id) AS bref')
->from('machine m')
->leftJoin('m.relations r ON r.machine_id=m.id')
->leftJoin('r.ref f ON r.ref_id=f.id AND f.part_number LIKE "B%"')
->groupBy('m.questionaire')
;
$r1 = $q1->execute();
$q1q = $q1->getSqlQuery();
$q2 = Doctrine_Query::create()
->select('m.questionaire, COUNT(f.id) AS nonbref')
->from('machine m')
->leftJoin('m.relations r ON r.machine_id=m.id')
->leftJoin('r.ref f ON r.ref_id=f.id AND f.part_number NOT LIKE "B%"')
->groupBy('m.questionaire')
;
$r2 = $q2->execute();
$q2q = $q2->getSqlQuery();
$this->reports->setQuery(Doctrine_Query::create()
->select('')
->from('(SQL:'.$q1q.'} q1')
->leftJoin('(SQL:'.$q2q.') q2 ON q1.questionaire=q2questionaire')
);
echo $this->reports->getQuery()->getSqlQuery(); die;
This outputs Couldn't find class (SQL
How to use in such a case ?
What is the SQL: syntax you are using here? That is definitely not something that is "supported"