I have 3 tables:
Persons (PersonID, Name, SS)
Fears (FearID, Fear)
Person_Fear (ID, PersonID, FearID)
Now I would like to list each person with some kind of fear associated with them (there can be many fears, but there can also be a nickname). A table of persons should be shown, even if a person does not have the fear associated with them.
I think I need to do a LEFT JOIN, but my code does not seem to work:
SELECT persons.name, persons.ss, fears.fear FROM persons LEFT JOIN fears ON person_fear.personid = person_fear.fearid
What am I doing wrong here? Thanks in advance.
sql join mysql table
Joe Apr 25 '13 at 18:30 2013-04-25 18:30
source share