Expression #1 of ORDER BY clause is not in SELECT list, references column 'rceonlin_rede.eventos.data' which is not in SELECT list; this is incompatible with DISTINCT in SELECT DISTINCT MONTH(data) as value, MONTHNAME(data) as mes FROM eventos ORDER BY data ASC