Menu Close

MySQL判断时间段是否重合

--- 时间段 s,t
SELECT * FROM table WHERE
       (start_time >= s and end_time <= t) -- 被包含了
    or (end_time >= s and end_time <=t)
    or (start_time >= s and start_time <=t)
    or (start_time <= s and end_time >=t)

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注