Possible Duplicate:
Concatenate values based on ID
I have two tables
table1 contains
pkUserSubjectid UserId fkSubjectId
15 146 1
16 146 2
17 146 4
18 147 1
19 147 3
20 148 1
21 148 3
22 149 1
23 149 3
table 2 contains
pkSubjectId SubjectName
1 Maths
2 English
3 Physics
4 Chemistry
5 Computer
I want my result in this format
UserId SubjectName
146 Maths, English, Chemistry
147 Maths, Physics
and so on
Please tell me any query in SQL