问题描述:

Hello i have this Clause:

SELECT y,

CASE WHEN (v IS NULL) THEN 0 ELSE SUM(v.viewCount) END AS HIDDEN sumviewcount

FROM YTScraperBundle:YouTubeVideo y

LEFT JOIN y.allViews v WITH v.firstFetch BETWEEN :fromDate AND :toDate

GROUP BY y ORDER BY sumviewcount DESC

Which works completly fine, but when i attempt to add a WHERE clause, like:

SELECT y,

CASE WHEN (v IS NULL) THEN 0 ELSE SUM(v.viewCount) END AS HIDDEN sumviewcount

FROM YTScraperBundle:YouTubeVideo y

LEFT JOIN y.allViews v WITH v.firstFetch BETWEEN :fromDate AND :toDate

WHERE y.name LIKE :videoName

GROUP BY y ORDER BY sumviewcount DESC

videoName is bound like this:

$query->setParameter('videoName', "%" . $searchData['searchValue'] . "%");

So that is not the issue, anyway the error i am getting is:

Error: Expected end of string, got 'y'","class":"Doctrine\\ORM\\Query\\QueryException

相关阅读:
Top