I am using MS SQL Server.
I have a table of students like this:
StudentID,Teacher
123,Adams
124,Adams
125,Johnson
126,Johnson
127,Adams
128,Marks
I need to have output that looks like this:
Teacher,Students
Adams,123|124|127
Johnson,125|126
Marks,128
I appreciate your help. Thank you.