I have three tables:
students, modules and students_modules (which is a linking table). What I am trying to do id selecting the modules associated with a particular student. I know that this is wrong but what I’m trying to do is something like this:
SELECT id, name
FROM modules
WHERE id = (SELECT moduleID FROM students_modules WHERE studentID = '123')
So could any one help me please.
Use
JOINto link the three tables with each others: