Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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
检查PostgreSQL中的时间范围是否重叠,没有单独的开始和结束字段_Postgresql - Fatal编程技术网

检查PostgreSQL中的时间范围是否重叠,没有单独的开始和结束字段

检查PostgreSQL中的时间范围是否重叠,没有单独的开始和结束字段,postgresql,Postgresql,我在postgre有一张桌子,上面有房间预订和商店: Room_id | Meet_time | 123456 | [9:00 - 10:00) | 房间id见面时间| 123456 | [9:00 - 10:00) | 我想检查123456房间9:30到10:00是否有空。我该如何检查?您可以通过&&操作员检查范围重叠情况(请参阅)。 因此,要检查给定时间范围内的所有免费房间,您可以使用以下查询: select * from <your table> as T where

我在postgre有一张桌子,上面有房间预订和商店:

Room_id | Meet_time | 123456 | [9:00 - 10:00) | 房间id见面时间| 123456 | [9:00 - 10:00) |
我想检查123456房间9:30到10:00是否有空。我该如何检查?

您可以通过
&&
操作员检查范围重叠情况(请参阅)。 因此,要检查给定时间范围内的所有免费房间,您可以使用以下查询:

select *
from <your table> as T
where not <given timerange> && T."Meet_time"
选择*
从as T
何处不&T“会面时间”

会面时间
日期范围
吗?根据表格,它是一个时间范围