Expression #10 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'hirlevel.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, 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 ('0') WHERE s.hash = 'fed842333804ef8df5c941638262d7f8' GROUP BY s.id