I have data that looks like this example for 1 user - I only have 1 table:
ID procedure date
12345 2 2023-02-27
12345 3 2023-02-06
12345 4 2023-02-13
12345 5 2023-02-27
12345 8 2023-02-27
I need it to be in 1 row as, with data in separate columns :
12345 2 2023-02-27 3 2023-02-06 4 2023-02-13 5 2023-02-27 8 2023-02-27
The codes 2,3,4,5, & 8 will be replaced by text probably using a case statement.
I've tried grouping, joining, concatenating but nothing is giving me the desired result.
Using a case statement approach is the closest I've gotten but it gave the date from the first row for all date columns and only gave the the procedure correctly in 2 of the columns, the others it gave me a null.