Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mobitour.adm_eventi_citta.data_citta' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by SELECT DISTINCT DATE_FORMAT(data_citta, '%d-%m-%Y') as data, data_citta as data_concerto, id_citta as citta, price_ticket, discount, closed FROM adm_eventi_citta WHERE id_evento ='' GROUP BY data ORDER BY data_citta