1
That consultation
SELECT DATE_FORMAT(data,'%d/%m/%Y') AS ALIASdata
FROM departamentos
ORDER BY data DESC
me returns the dates in the order I want
18/05/2020
17/04/2019
17/05/2018
17/03/2018
17/03/2015
17/03/2014
If I run this query, with ALIAS equal to column name
SELECT DATE_FORMAT(data,'%d/%m/%Y') AS data
FROM departamentos
ORDER BY data DESC
return me a unexpected order
18/05/2020
17/05/2018
17/04/2019
17/03/2018
17/03/2015
17/03/2014
Why does that happen?