SQL date intervals query

前端 未结 3 2018
無奈伤痛
無奈伤痛 2021-01-21 12:03

I am managing an event database. Every event has a start and end timestamp (INT, unix timestamp).

Currently i\'m able to do the following things with a sing

3条回答
  •  攒了一身酷
    2021-01-21 12:33

    I think you should modify query like this:

    SELECT * FROM `event` WHERE ? BETWEEN `start` AND `end` ORDER BY start ASC
    

    where param ? is the current date or current timestamp.

提交回复
热议问题