add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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)
10 rows affected
Id SD ED Status Assignment lag_status grp original_hire_date recent_hire_date
1 2020-01-01 2020-01-15 A A1 null 0 2020-01-01 2020-01-01
1 2020-01-16 2020-02-01 T null A 0 2020-01-01 2020-01-01
1 2020-02-02 2021-03-20 A null T 1 2020-01-01 2020-02-02
1 2021-03-21 2022-10-01 A B6 A 1 2020-01-01 2020-02-02
1 2022-10-02 2023-01-01 T null A 1 2020-01-01 2020-02-02
1 2023-01-02 2023-05-12 A A1 T 2 2020-01-01 2023-01-02
2 2022-01-03 2022-02-01 A B2 null 0 2022-01-03 2022-01-03
2 2022-02-02 2023-11-01 T null A 0 2022-01-03 2022-01-03
2 2023-11-02 2023-05-12 A A8 T 1 2022-01-03 2023-11-02
3 2022-10-15 2023-05-12 A A1 null 0 2022-10-15 2022-10-15
Warning: Null value is eliminated by an aggregate or other SET operation.