I am have a table:
Student| Grade
qwe | 100
qwe | 95
qwe | 90
asd | 85
asd | 90
zxc | 80
zxc | 75
zxc | 100
and my Expected output like this, How can I do that?
Student | Grade
qwe | 100; 95; 90
asd | 85; 90
zxc | 80; 75; 100
I tried like this but it is wrong:
SELECT d.Student, d.Grade FROM Data d GROUP BY d.Student
Please, help.
Thanks to everyone. I used this query and it works:
SELECT DISTINCT t1.Student,
( SELECT t2.Grade+'; '
FROM Data t2
WHERE t2.Student = t1.Student
FOR XML PATH('') ) Concatenated
FROM Data t1