By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| patientId | detailId | value |
|---|---|---|
| 123456 | 75 | 01 |
| 123456 | 89 | 12/01/2022 |
| 123456 | 151 | 03 |
| 123456 | 215 | 56813 |
| 678910 | 75 | 01 |
| 678910 | 203 | 12/01/2022 |
| 678910 | 151 | 03 |
| 678910 | 215 | 56813 |
| patientId | detailId | value | RowNum |
|---|---|---|---|
| 123456 | 151 | 03 | 1 |
| 678910 | 203 | 12/01/2022 | 1 |