Expression #1 of ORDER BY clause is not in SELECT list, references column 'rceonlin_rede.noticias.data' which is not in SELECT list; this is incompatible with DISTINCT in SELECT DISTINCT MONTH(data) as value, MONTHNAME(data) as mes FROM noticias WHERE id != 69 AND id != 68 ORDER BY data ASC