how to format date field in MYSQL

前端 未结 5 1926
粉色の甜心
粉色の甜心 2021-01-25 07:13

All,

I need to retrieve the date in some specific format in MYSQL. For eg,

it should return month/year(10/2009).

My MYSQL version is 5.1.

Thanks

5条回答
  •  萌比男神i
    2021-01-25 07:36

    Check the documentation for this function in MySQL

    DATE_FORMAT(date, format)

    DATE_FORMAT(col, '%m/%Y')
    

提交回复
热议问题