With mysql >= 5.7, this does not work anymore - it returns an empty array (and hides the SQL error). The issue is with the GROUP BY clause, whose behaviour was changed with this update.
http://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by
The easiest solution is to revert back to previous mysql behaviour, which can be accomplished by setting sql-mode to TRADITIONAL. This can be done at runtime globally, per session or at startup in a config file.
https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html
Easiest for me was to update my.cnf to contain sql_mode=TRADITIONAL under [mysqld], which removes the problematic ONLY_FULL_GROUP_BY mode.
Of course a better solution would be to update the SQL query.
With mysql >= 5.7, this does not work anymore - it returns an empty array (and hides the SQL error). The issue is with the GROUP BY clause, whose behaviour was changed with this update.
http://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by
The easiest solution is to revert back to previous mysql behaviour, which can be accomplished by setting sql-mode to TRADITIONAL. This can be done at runtime globally, per session or at startup in a config file.
https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html
Easiest for me was to update my.cnf to contain sql_mode=TRADITIONAL under [mysqld], which removes the problematic ONLY_FULL_GROUP_BY mode.
Of course a better solution would be to update the SQL query.