i want get rows individually with condition that sum of prizes equals to my parameter (price) actually i want limit number of rows in prize entity but i get this error:
SQLSTATE[HY000]: General error: 1111 Invalid use of group function
this is my query :
$qb = $this->createQueryBuilder('up')
->join('up.prize','prize')
->select()
->where('up.user = :user')
->andWhere('SUM(prize.prizeValue) <= :price')
->setParameters(['user'=>$user , 'price'=>$price])
->getQuery()
->getResult();
return $qb;