I am fairly new to Pivoting and trying to Pivot based on two columns.
Data I have:
Data I want to Achieve after pivoting:
My Query which is Flawed:
select *
from
(
select ISSUEID,ANSWER, ANSWERCOMMENT,QUESTION ,QUESTIONID
from issue_survey
WHERE ISSUEID = 6877
) d
pivot
(
max(QUESTION)
for QUESTIONID in (1 QUESTION1,2 QUESTION2, 3 QUESTION3)
) piv;
The Results I am getting with this flawed query:
Any suggestions with this are appreciated. Thank you!


