MySQL Forums
Forum List  »  Spanish

Re: COUNT y SUM con JOIN
Posted by: Marco Rios
Date: December 04, 2018 12:40PM

Ruben,
a partir de la versión 5.7 se ha habilitado por defecto el MODO ESTRICTO, para poder ejecutar tu consulta tal cómo lo hacías anteriormente, requieres cambiar el MODO, ya sea a nivel global (lo cuál no te recomiendo), o a nivel de SESION

Para esto, agrega al inicio la siguiente línea:
SET SESSION sql_mode = MODO;
donde MODO será el modo deseado

los modos habilitados por defecto son:
ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE,
NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, and
NO_ENGINE_SUBSTITUTION.

de los cuáles me aventuraría a asegurar que el que te está afectando es
ONLY_FULL_GROUP_BY

si pones
SET SESSION sql_mode = '';
restituirás al modo por defecto anterior, sin embargo hay que tener cuidad si esto no te afectará.

Tal vez prefieras modificar tu consulta agregando los nombres de las columnas faltantes en la cláusula GROUP BY

Thanks in advance for your valuable help.

Acer LENOVO G450
CPU: Pentium(R) Dual-Core CPU T4400 @ 2.20GHz × 2
RAM: 4GB
Graphics: Intel GM45
OS: UBUNTU 18.04.4 LTS 64bits
GNOME 3.28.2
--
Best regards
Marco
Mexico City, Mexico

Options: ReplyQuote


Subject
Views
Written By
Posted
1804
November 15, 2018 09:57AM
584
November 15, 2018 06:37PM
Re: COUNT y SUM con JOIN
620
December 04, 2018 12:40PM
719
December 09, 2018 08:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.