Skip to main content

Solución de Error 500 por group by estricto

You are here:
← All Topics

Si se despliega este error:

CDbCommand falló al ejecutar la sentencia SQL: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'NOMBRE_BASE_DE_DATOS.i.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Lo más probable es que en mysql este configurado el comportamiento llamado only_full_group_by

Para verificar, ejecute:

select @@sql_mode;

Para corregir la configuración ejecute el siguiente comando:

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));