| id | first (datetime) | last (datetime)
--------------------------------------------------------
| 1 | 2013-04-15 00:00:00 | 2013-04-21 23:59:00
| 2 | 2013-04-08 00:00:00 | 2013-04-14 23:59:00
| 3 | 2013-04-01 00:00:00 | 2013-04-07 23:59:00
| 4 | 2013-04-01 00:00:00 | 2013-04-07 23:59:00
我想显示记录日期时间范围是否涵盖今天的记录。 (此示例的 3 和 4)
我尝试用两个人来做这个NOW()
,它在第二个给出语法错误NOW()
.
我怎样才能做到这一点?
select *
from your_table
where current_date() between first_datetime and last_datetime
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)