SELECT SUBSTR(sdate,6,10) AS sdate,SUBSTR(edate,6,10) AS edate FROM ad_products WHERE sdate!="0000-00-00" AND status=1 AND cat="1" AND (langs LIKE "%all%" OR langs LIKE "%ro%") GROUP BY sdate ORDER BY sdate ASC Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'host_77_1_new.ad_products.edate' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by