salut,
J'ai une requête qui fonctionne :
1 2
| $q = Doctrine_Query::create()->from( "Cours c" );
$q = $q->andWhere( "not exists(select 1 from ClientCours c2 where c.id = c2.cours_id and c2.client_id = ?)", $this->pClientId ); |
J'aimerais lui ajouter cette ligne :
$q = $q->andWhere( "c.nbMax > (select count(*) from ClientCours c3 where c.id = c3.cours_id)" );
mais j'obtiens l'erreur
Couldn't find class c3
Alors que la requête suivante fonctionne :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| SELECT c.id AS c__id, c.moniteur_id AS c__moniteur_id, c.nom AS c__nom, c.datedebut AS c__datedebut, c.datefin AS c__datefin, c.nbmax AS c__nbmax, c.prix AS c__prix, c.annule AS c__annule
FROM Cours c
WHERE
(
c.annule IS NULL AND c.nom LIKE '%t%'
AND
(
NOT (exists (select 1 from ClientCours c2 where c.id = c2.cours_id and c2.client_id = '14') )
)
AND
(
c.nbMax > (select count(*) from ClientCours c3 where c.id = c3.cours_id)
)
)
LIMIT 3 |
je ne comprend pas quel est le problème, qqun aurait une idée ?
Merci d'avance
Partager