Hello

Since mysql 5.7.5 group by have change

https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html

If I made this query

$qb = $this->createQueryBuilder('d');
$qb->select('ANY_VALUE(d.id), d.nom, count(d.nom) as lignes');
$qb->groupBy('d.nom');   
$qb->orderBy('d.nom');

I have a error

Expression #1 of SELECT list is not in GROUP BY clause and contains 
nonaggregated column 'sepultures.d0_.id' which is not functionally 
dependent on columns in GROUP BY clause; this is incompatible with 
sql_mode=only_full_group_by

As explain in mysql doc, this problem can resolve with any_value like this

$qb = $this->createQueryBuilder('d');
$qb->select('ANY_VALUE(d.id), d.nom, count(d.nom) as lignes');
$qb->groupBy('d.nom');   
$qb->orderBy('d.nom');

But doctrine don't recognize this function

[2/2] QueryException: [Syntax Error] line 0, col 7: Error: Expected known 
function, got 'ANY_VALUE'

How can I resolve it ?

Thank



-- 
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