验证会议室在某一时间段内是否被占用SQL

Select * From HuiYi
where
(时间字段1 Between BeginDate(时间参数1) and EndDate(时间参数2))
or (时间字段2 Between BeginDate(时间参数1) and EndDate(时间参数2))
or (时间参数1 Between 时间字段1 and 时间字段2)
or (时间参数2 Between 时间字段1 and 时间字段2)


说明:时间字段1、2是数据表字段名;时间参数1、2是选择的时间段。
原文地址:https://www.cnblogs.com/snlfq2000/p/1386720.html