January 23, 2014 at 2:08 pm
I have the following data
TeacherIdStudentid
11111
21112
11113
21114
11115
11116
11117
11118
21119
31110
31120
31121
21122
21123
11124
11125
I need a result set like the following with the above data
teacherIdStudentId
11111,1113,1115,1116,1117,1118,1124,1125
21112,1114,1119,1122,1123
31110,1120,1121
I need to concatenate all the student Ids of each teacher and should store in a single column for each teacher.
How can I do this?
January 23, 2014 at 2:12 pm
Check the following article: http://www.sqlservercentral.com/articles/comma+separated+list/71700/
It explains how to solve your problem.
If you have any specific questions, feel free to ask.
January 23, 2014 at 2:29 pm
Thanks for quick help. It worked perfectly.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply