Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql在两列[Start_date]和[End_date]之间查找日期_Mysql - Fatal编程技术网

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"

我想在这两个日期开始日期和结束日期之间找到我自己的日期太棒了!它的工作很有魅力