I have a table with data records:
T1:
Example T1 Data:
Unique_id RatingA RatingB RatingC
123 1 3 Null
456 -1 Null 2
I have another table with a code that equates to the ratings,
T2:
Rating_Name Rating_Code
RatingA 11
RatingB 21
RatingC 31
I need to send the Unique_id
from T1
, rating codes from T2
with the Rating values from T1
.
Desired output
My export file should look like this, taking the Rating from the corresponding column (A, B or C):
Unique_id Rating_Code Rating
123 11 1
123 21 3
123 31 (null)
456 11 -1
456 21 (null)
456 31 2
How do I do this?