Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在一家餐厅做一个项目,我已经预订了餐桌。我在计算两次之间的时间跨度时遇到问题。它应该是这样的:
如果一个人想预订餐桌,他是在约会和两次。我将不得不检查这两次之间的时间跨度是否有任何预订。我已将我的表格结构的屏幕截图与这个问题放在一起。请帮我。
(全尺寸图片在这里。)
select * from booking where (user_from between (booking_time_from AND booking_time_to)) or (user_to between (booking_time_from AND booking_time_to))
user_from用户user_to输入时间在哪里
user_from
user_to