Expression #13 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fondoc2x_db.l.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by: SELECT *, INET_NTOA(s.ip) AS ip, INET_NTOA(l.ip4) AS ip4, TRIM(CONCAT(first_name, ' ', last_name)) AS name, s.id AS id, l.id AS lid FROM em_subscriber s LEFT JOIN em_subscriber_list l ON s.id = l.subscriberid AND l.listid IN ('53','52','40','39','9','11','38','19','43','62') WHERE s.hash = '0112cf851376e25b4e3c6e77d4fb1e1c' GROUP BY s.id ORDER BY l.id DESC