在我的一个mysql表中,我有start
stop
列。
例如,start的值为2011-01-21
,stop的值为2011-03-23
。
假设今天2011-03-10
如何确定“今天”是在开始和停止期间之间?
答案 0 :(得分:5)
select * from mytable where CURDATE() between start and stop
答案 1 :(得分:0)
select
*
from
`tbl`
where
now() between `the_start_date` and `the_end_date`
答案 2 :(得分:0)
嗯有点模棱两可,但你今天可以将日期存储在一个变量中并执行“select start,stop from table”然后在PHP for循环中你可以评估你今天的变量是否在两个日期值之间?