Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqlserver_newbee
Starting Member
11 Posts |
Posted - 2008-10-14 : 14:33:34
|
ID Start_Date End_Date PRoll--------------------------------------------------------------------------1 02-03-2007 02-03-2008 1A1 03-31-2008 12-12-2008 1C2 01-01-2008 04-25-2008 2A2 03-03-2008 10-21-2008 2B3 05-06-2007 08-01-2007 3A3 08-08-2007 08-08-2008 3BI have a set like above where each id has multiple segments. I want to get all the ids where the segments are overlapping. For example ID 2 where End_Date on first segments is > Start Date of second segment. The dataset is sorted on ID, Start and End Date.I am not able to come with the best way of finding overlapping segments for each id. I appreciate all your suggestions!Thanks!PS - I just realized I posted the question in SQL Server Development instead of Transact-SQL forum. Sorry for multiple posts admin team. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|