Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'prossima-casa.affiliates_ind_province.ind_province_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_bySELECT SQL_CALC_FOUND_ROWS id,url,gruppo,ind_regioni_id, affiliates_ind_province.ind_province_id FROM affiliates INNER JOIN affiliates_ind_province ON = affiliates_ind_province.affiliates_id WHERE flag_pc_network=1 AND online = 1 AND ind_regioni_id = 2 GROUP BY id ORDER BY url ASC