I want to be able to see the rows from different table in a single column .
Just like this question How to select row/s from an other table using a comma-separated value from the first table? (which is a duplicate of this question: MySQL Join two tables with comma separated values :) but for Sql Server.
Tables from link:
Table 1. faculty
subject |
---|
101, 102 |
104 |
103, 105 |
Table 2. subject
code | subject |
---|---|
101 | subject 1 |
102 | subject 2 |
103 | subject 3 |
104 | subject 4 |
105 | subject 5 |
Expected Output:
subject | subject |
---|---|
101, 102 | subject 1, subject 2 |
104 | subject 4 |
103, 105 | subject 3, subject 5 |
Basically I don't want to see multiple columns for joins but all corresponding values in on column comma separated.