I'm a fairly newbie to Doctrine. I've run into a query that I can't find 
any tutorials or answers on how to perform it through querybuilder. Any 
assistance would be so very much appreciated. Here is my sql query that I'm 
trying to perform: 
 SELECT COUNT(mwl.IDENTIFIER) FROM (SELECT MOVIE_ID, PERSON_ID, IDENTIFIER, 
MAX( TIMESTAMP ) FROM MOVIE_WATCHLIST WHERE MOVIE_ID = 2 OR MOVIE_ID = 3 or 
MOVIE_ID = 0 GROUP BY PERSON_ID) AS mwl LEFT JOIN PERSON p ON mwl.PERSON_ID 
= p.IDENTIFIER WHERE p.MOVIE_CODE_FAVORITE = 1 OR p.MOVIE_CODE_FAVORITE = 2




This does not work:

$this->queryBuilder
 ->select("COUNT('mwl.IDENTIFIER')")
 ->from("(SELECT MOVIE_ID, PERSON_ID, IDENTIFIER, MAX( TIMESTAMP ) FROM 
MOVIE_WATCHLIST WHERE MOVIE_ID = 2 OR MOVIE_ID = 3 or MOVIE_ID = 0 GROUP BY 
PERSON_ID)", "mwl")
 ->leftJoin("p", "PERSON", "mwl", "mwl.PERSON_ID = p.IDENTIFIER")
 ->where("p.MOVIE_CODE_FAVORITE = 1")
 ->andWhere("p.MOVIE_CODE_FAVORITE = 2");

This is the error that I get:

Fatal error: Call to a member function select() on string

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to