By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
(No column name) |
---|
Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64) Oct 8 2022 05:58:25 Copyright (C) 2022 Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor) |
PersonId | fromdate | todate | rn | refdate |
---|---|---|---|---|
1 | 2014-07-05 | 2014-07-06 | 1 | 2014-07-06 |
1 | 2014-09-23 | 2014-09-24 | 3 | 2014-09-24 |
1 | 2014-10-30 | 2014-10-31 | 5 | 2014-10-31 |
2 | 2014-07-20 | 2014-07-25 | 1 | 2014-07-25 |
2 | 2014-09-21 | 2014-09-22 | 3 | 2014-09-22 |