0
People I have the following query made.
$ent->createQueryBuilder('t')
->select('count(t.id)')
->join('t.categoria', 'c')
->join('t.noticia', 'n')
->groupBy('n.id')
->where('n.posicao=1')
->andWhere('c.id=16')
->andWhere(' t.deleted_at IS NULL OR LENGTH(t.deleted_at) = 0')
->getQuery()
->getSingleScalarResult();
Only that it is not returning me only a column with Count. I believe it is because of groupBy. How I hit it to only return Count’s total without taking out groupBy. Thank you
What the query is returning?
– Rodrigo Rigotti
@Rodrigorigotti Returns an error saying that multiple columns are being returned.
– Joao Nivaldo
@Rodrigorigotti this is the error message returned:
The query returned multiple rows. Change the query or use a different result function like getScalarResult()
– Joao Nivaldo