检查PostgreSQL中的时间范围是否重叠,没有单独的开始和结束字段
我在postgre有一张桌子,上面有房间预订和商店: Room_id | Meet_time | 123456 | [9:00 - 10:00) | 房间id见面时间| 123456 | [9:00 - 10:00) |检查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
我想检查123456房间9:30到10:00是否有空。我该如何检查?您可以通过
&&
操作员检查范围重叠情况(请参阅)。
因此,要检查给定时间范围内的所有免费房间,您可以使用以下查询:
select *
from <your table> as T
where not <given timerange> && T."Meet_time"
选择*
从as T
何处不&T“会面时间”
是
会面时间是日期范围吗?根据表格,它是一个时间范围