What is a simple and efficient way to find rows with time-interval overlaps in SQL?

后端 未结 5 1556
清歌不尽
清歌不尽 2020-11-30 00:22

I have two tables, both with start time and end time fields. I need to find, for each row in the first table, all of the rows in the second table where the time intervals in

5条回答
  •  悲&欢浪女
    2020-11-30 00:37

    And what, if you want to analyse such an overlap on a minute precision with 70m+ rows? the only solution i could make up myself was a time dimension table for the join

    else the dublicate-handling became a headache .. and the processing cost where astronomical

提交回复
热议问题