我有一个包含 2 列 startdate 和 enddate 的表,用于存储特定场所中有趣节目的开始和结束时间。(两列的格式均为 datetime-format 为 'Ymd H:i:s')。当用户创建a program within this time limit
或the end time of the program lies within the time limit but not the start time
或the start time lies within the time limit but not the end time
,程序不应插入显示警报的表中。我已经编写了这样的查询。但它不能正常工作。
SELECT * FROM tbl_venue WHERE venue_id='id' AND
((venue_start_datetime BETWEEN 'entered starttime' AND 'entered end time')
AND (venue_stop_datetime BETWEEN 'entered starttime' AND 'entered end time'))
提前致谢。