i want to do run that query with doctrine query builder
select * from stats group by MINUTE(date_time)
i have tried this query builder but thrown exception
[Semantical Error] line 0, col 50 near 'MINUTE(s.dateT': Error: Cannot group by undefined identification or result variable.
$queryBuilder =
$entityManager->createQueryBuilder('Application\Entity\Stats');
$queryBuilder->select('s')
->from('Application\Entity\Stats', 's');
$queryBuilder->groupBy('MINUTE(dateTime)');
how do i group by with minute
The error shows you that you cannot group by result. If you can do it with row SQL just try this