Select records from NOW() -1 Day

前端 未结 6 1600
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 13:38

Is there a way in a MySQL statement to order records (through a date stamp) by >= NOW() -1 so all records from the day before today to the future are selected?

6条回答
  •  孤城傲影
    2020-12-04 14:25

    Sure you can:

    SELECT * FROM table
    WHERE DateStamp > DATE_ADD(NOW(), INTERVAL -1 DAY)
    

提交回复
热议问题