How do I select a date in the format dd / mm / yyyy in mysql? [duplicate]

1

Good morning / afternoon / evening

I need to select a field of TYPE DATE in mysql, the data is in the format yyyy-mm-dd , I need to return dd/mm/yyyy . Is there any way to do this in select?

I have seen solutions with the date_format function, but I did not succeed.

Thank you in advance.

    
asked by anonymous 03.05.2017 / 15:50

1 answer

1

I was doing it the wrong way. I ended up trying again and it worked.

SELECT DATE_FORMAT(STR_TO_DATE('campo', '%Y-%m-%d'), '%d/%m/%Y') FROM 'tabela'

    
03.05.2017 / 15:58