SQL GROUP BY Statement - Error
Posted: Thu Sep 30, 2021 11:28 am
Hi!!
I have this problem in Nubuilder (latest release), developing this database for the music album collection.
I made a simple query to get the total number of records by music genre. If I run it on the phpMyAdmin console, it works OK !!! (in attachment)
SELECT generi.des_generi, COUNT(*) AS total
FROM generi JOIN lpcdbox ON lpcdbox.genere_lpcdbox = generi.generi_id
GROUP BY generi.des_generi ASC;
If I implement it in Nubuilder (SQL builder or manually), it gives me this incompatibility error with sql_mode. in debug.. and nothing results ..
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Sql1529862_3.lpcdbox.LPCDBOX_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
how can i solve it!?
ThAnks, Marco
I have this problem in Nubuilder (latest release), developing this database for the music album collection.
I made a simple query to get the total number of records by music genre. If I run it on the phpMyAdmin console, it works OK !!! (in attachment)
SELECT generi.des_generi, COUNT(*) AS total
FROM generi JOIN lpcdbox ON lpcdbox.genere_lpcdbox = generi.generi_id
GROUP BY generi.des_generi ASC;
If I implement it in Nubuilder (SQL builder or manually), it gives me this incompatibility error with sql_mode. in debug.. and nothing results ..
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Sql1529862_3.lpcdbox.LPCDBOX_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
how can i solve it!?
ThAnks, Marco