I have a table which has patient information and some values. The patient identifier can be repetitive in a table i.e., there can be multiple records per patientID. Example of the table:
ID Result
1 Positive
1 Negative
2 NULL
2 Negative
2 In-conclusive
3 Negative
3 Positive
3
4 Positive
2 Positive
I need the above values converted from rows to columns. It should look like below:
ID Result1 Result2 Result3 Result4
1 Positive Negative
2 Negative Inconclusive Positive
3 Negative Positive
4 Positive
Pivot uses aggregate functions to accomplish the task. But I want to use PIVOT without aggregate function. Is that possible?
Can you please tell me how to do it?
TIA, Sri