I have data like below
| Name | Subject | Answer |
|:----------|:----------|:---------------------:|
|Pranesh |Physics |Numerical Problems |
|Pranesh |Physics |Other |
|Pranesh |Chemistry |Understanding Concepts |
|Pranesh |Chemistry |Organic chemistry reactions
|Pranesh |Maths |Lack of understanding |
|Pranesh |Maths |Insufficient practice |
|Pranesh |Maths |Other |
Using this SQL query:
select *
from
(select
l.FullName Name, sq.Title Subject, cAns.Name Answer
from
Answer as sa
left join
Question AS sq on sq.ID = sa.QuestionID
left join
Master as cAns on cAns.ID = sa.AnswerID
left join
Profile as l on l.ID = sa.ProfileID) src
pivot
(max(Answer)
for Subject in ([Physics], [Chemistry], [Maths], [Biology],[ComputerScience], [CommonUnderstanding])) piv;
I am able to get the data as follows
How to concatenate answer column of same subject and display the same like in above screen shot ?
