Expression #15 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' 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_sub) AS ip4, TRIM(CONCAT(first_name, ' ', last_name)) AS name, AS id, AS lid FROM em_subscriber s LEFT JOIN em_subscriber_list l ON = l.subscriberid AND l.listid IN ('45') WHERE s.hash = 'bad97c655476f96a390a72c05a742011' GROUP BY