I'm trying to get this
PatID FacID RxNo RejectCd
121403 463 57074566 R9
121403 463 57074566 76
121403 463 57074566 88
121403 463 57074566 8C
To look like this
PatID FacID RxNo RejectCd
121403 463 57074566 R9,76,88,8c
Tried using a pivot or doing it in stages but I'm stuck. Can't pivot because I don't have a field for the column names. Also don't know how many Reject Codes will actually exist till it runs but we can ignore that part for now. I think this will be really challenging for any SQL nerds out there. Thank u!