我想如果计算的日期是几日期是在我database.1SQL比较日期
之间。例如: 我有日期:29-02-2016
我有一些我的条目数据库有2列,start date
和end date
。
现在我想选择与例如日期碰撞我的数据库行。 所有日期都在时间戳中。
因此,例如,我有我的数据库中下一行:
start date: 11-2-2016 => end date: 12-2-2016 //does not match
start date: 28-2-2016 => end date: 30-2-2016 //does match
有谁知道如何从我的数据库选择它们?
使用'between'关键字。 –
的可能的复制[检查当前日期是两个日期+ mysql的选择查询之间(http://stackoverflow.com/questions/13563423/check-if-the-current-date-is-between-two-dates- mysql-select-query) –