How to select only date from a DATETIME field in MySQL?

前端 未结 16 2064
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 04:37

I have a table in the MySQL database that is set up with DATETIME. I need to SELECT in this table only by DATE and excluding the time.

How d

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 05:10

    Simply You can do

    SELECT DATE(date_field) AS date_field FROM table_name
    

提交回复
热议问题