Tables 1 as below
User_Option_Experience
user_id | teaching_in
|
111 | 1,2,3
112 | 1,4
113 | 4,2
Tables 2 as below
Teaching_in
IdTeaching | name
|
1 | Biology
2 | Chemistry
3 | Mathematics
Now what i want is to have an output of all the names of subjects a User (Teacher) teaches in because one user as seen from the table can teach many subjects
For example I want all the subjects for user with id 111
I tried this but no success as it returns only one record
select teaching_in.name
from teaching_in
left
join users_options_experience
on user_options_experience.teaching_in = teaching_in.IdTeachingin
where user_options_experience.user_id = 15605