I am using SQL Server.
I have a table of students like this:
StudentID TeacherNumber
123 1
124 1
125 2
126 2
127 1
128 3
I also have a table of teachers like this:
TeacherNumber TeacherName
1 Adams
2 Johnson
3 Marks
I need to have output that looks like this:
TeacherNumber Teacher Students
1 Adams 123|124|127
2 Johnson 125|126
3 Marks 128
I appreciate your help. Thank you.
I posted a similar question previously, and got a response that worked here:
How to generate sql output as piped
Now that I added another table I am having trouble. I appreciate the help.