• Eric M Russell (2/10/2016)


    Hugo,

    My script returns the duplicate listed below, but your's appears to return none.

    MemNoYMDStart YMDEndYMDStart YMDEnd

    417 2001-10-01 2001-09-30 2001-06-01 2001-09-30

    True. And one might debate whether or not an interval that ends before it even starts is able to overlap with other intervals or not.

    Either way, I already mentioned in my post that these negative-length intervals will probably cause weird results. They should be filtered out before even starting to look for overlapping intervals.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/