I have 3 tables that look something like this:
Table A
Student id | Course Name |Course Section
1 | English |A
1 | Math |B
2 | Chemistry |C
2 | History |A
Table B
Course Name |Course Section |Instructor ID |Percentage
Math |B |67890 |50
Math |B |54321 |50
History |A |67890 |100
English |A |12345 |100
Chemistry |C |09876 |100
Table C
Instructor ID |Instructor Email
09876 | instrchem@testco.us
12345 |instreng@testco.edu
54321 |instrmathalso@testco.us
67890 |instrhist@testco.edu
I want the output of my query to look like this:
StudentID Course Name Section Instructor Email
1 English A instreng@testco.edu
1 Math B instrhist@testco.edu;instrmath@testco.us
2 Chemistry C instrchem@testco.us
2 History A instrhist@testco.us
I have tried creating a table variable, using coalesce, and a couple of other suggestions, but I'm not having any success. Any ideas would be greatly appreciated.
Thank you.
eileen