By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| persnr | id | lastchecked | lastcheckedby_user |
|---|---|---|---|
| 00123 | 1061 | 2020-10-21 | me |
| 00124 | 1062 | 2020-10-21 | you |
| ID_Card | License | Valid_till | Valid_from | Details_description |
|---|---|---|---|---|
| 1061 | A | 2022-01-01 | 2018-01-01 | 95389 |
| 1061 | B | 2025-02-19 | 2018-04-01 | 79064 |
| 1061 | C | 2024-03-16 | 2018-09-11 | 84532 |
| 1062 | A | 2021-03-15 | 2019-11-11 | 83499 |
| 1062 | CE | 2022-04-01 | 2020-03-31 | NewLicense |
| persnr | lastchecked | ID_Card | LicenseA | Valid_tillA | Valid_fromA | DescriptionA | LicenseB | Valid_tillB | Valid_fromB | DescriptionB | LicenseC | Valid_tillC | Valid_fromC | DescriptionC | LicenseCE | Valid_tillCE | Valid_fromCE | DescriptionCE |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00123 | 2020-10-21 | 1061 | null | null | null | null | null | null | null | null | C | 2024-03-16 | 2018-09-11 | 84532 | null | null | null | null |
| 00123 | 2020-10-21 | 1061 | null | null | null | null | B | 2025-02-19 | 2018-04-01 | 79064 | null | null | null | null | null | null | null | null |
| 00123 | 2020-10-21 | 1061 | A | 2022-01-01 | 2018-01-01 | 95389 | null | null | null | null | null | null | null | null | null | null | null | null |
| 00124 | 2020-10-21 | 1062 | null | null | null | null | null | null | null | null | null | null | null | null | CE | 2022-04-01 | 2020-03-31 | NewLicense |
| 00124 | 2020-10-21 | 1062 | A | 2021-03-15 | 2019-11-11 | 83499 | null | null | null | null | null | null | null | null | null | null | null | null |
| persnr | lastchecked | ID_Card | LicenseA | Valid_tillA | Valid_fromA | DescriptionA | LicenseB | Valid_tillB | Valid_fromB | DescriptionB | LicenseC | Valid_tillC | Valid_fromC | DescriptionC | LicenseCE | Valid_tillCE | Valid_fromCE | DescriptionCE |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00123 | 2020-10-21 | 1061 | A | 2022-01-01 | 2018-01-01 | 95389 | B | 2025-02-19 | 2018-04-01 | 79064 | C | 2024-03-16 | 2018-09-11 | 84532 | null | null | null | null |
| 00124 | 2020-10-21 | 1062 | A | 2021-03-15 | 2019-11-11 | 83499 | null | null | null | null | null | null | null | null | CE | 2022-04-01 | 2020-03-31 | NewLicense |
Warning: Null value is eliminated by an aggregate or other SET operation.