How to determine if a date range occurs any time within another date range?

前端 未结 5 1638
星月不相逢
星月不相逢 2021-02-02 04:07

I have an Event table that specifies a date range with start_date and end_date fields. I have another date range, specified in code, that defines the

5条回答
  •  爱一瞬间的悲伤
    2021-02-02 04:56

    In order...

    where start_date >= week_start and end_date <= week_end
    where start_date <= week_start and end_date >= week_start and end_date <= week_end
    where start_date >= week_start and start_date <= week_end and end_date > week_end
    where start_date < week_start and end_date > week_end
    

提交回复
热议问题