MySQL - Issue with SELECT & GROUP BY [SOLVED] |
Hello lovely CI Community,
I have a basic config MySQL 5.7 / PHP 7.0 with this DB :
Code: $this->db->from("pages"); and i have the following error : Code: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by So i made a lot of researches, and seems there are 2 solutions to fix it (more info here : https://dev.mysql.com/doc/refman/5.7/en/...dling.html) : 1/ To change the SQL mode ===> I don't want to change the default config 2/ To have the same column in the SELECT & GROUP BY ===> I need a lot of columns in the SELECT and not only the ones in GROUP BY. Especially if the query is more complicated with a lot more LEFT JOIN. I need to display all theses infos. Do you have any other solutions ? Alternative with other methods ? I'm open to anything What i need is to get the list of pages and for each page the tags linked to, in one query. It seems so easy but it doesn't work Thanks a lot !! |
Messages In This Thread |
MySQL - Issue with SELECT & GROUP BY [SOLVED] - by Coool6 - 11-29-2018, 06:05 AM
RE: MySQL - Issue with SELECT & GROUP BY - by Pertti - 11-29-2018, 06:49 AM
RE: MySQL - Issue with SELECT & GROUP BY - by Coool6 - 11-29-2018, 07:22 AM
RE: MySQL - Issue with SELECT & GROUP BY - by Pertti - 11-29-2018, 07:29 AM
RE: MySQL - Issue with SELECT & GROUP BY - by Coool6 - 11-29-2018, 07:47 AM
RE: MySQL - Issue with SELECT & GROUP BY - by Pertti - 11-29-2018, 08:29 AM
RE: MySQL - Issue with SELECT & GROUP BY [SOLVED] - by Ettore - 11-29-2018, 01:28 PM
RE: MySQL - Issue with SELECT & GROUP BY [SOLVED] - by creatiko - 03-19-2020, 02:37 PM
RE: MySQL - Issue with SELECT & GROUP BY [SOLVED] - by inumaru - 06-07-2021, 08:32 PM
|