Mysql在两列[Start_date]和[End_date]之间查找日期
我的桌子是这样的Mysql在两列[Start_date]和[End_date]之间查找日期,mysql,Mysql,我的桌子是这样的 |id|start_time|end_time|start_date|end_date | |01| 10:00Am | 10:PM |2014-08-19|2014-08-30| 我想在两列“开始日期”和“结束日期”之间找到我的具体日期 select start_time,end_time from table where 2014-08-24 <= end_date and >= start_date 如何找到我的具体日期我想您只需要在两种情况之间使
|id|start_time|end_time|start_date|end_date |
|01| 10:00Am | 10:PM |2014-08-19|2014-08-30|
我想在两列“开始日期”和“结束日期”之间找到我的具体日期
select start_time,end_time
from table
where 2014-08-24 <= end_date and >= start_date
如何找到我的具体日期我想您只需要在两种情况之间使用:
select start_time,end_time
from table
where '2014-08-24' between start_date and end_date
您应该在db行中使用日期,请尝试以下方法
SELECT `start_time`, `end_time`
FROM `table`
WHERE `start_date` <= "2014-08-24" AND `end_date` >= "2014-08-24"
我想在这两个日期开始日期和结束日期之间找到我自己的日期太棒了!它的工作很有魅力