So here’s my problem. I have three tables:
Person Table
person_id, name
Events Table
event_id, event_name, event_date
Matches Table
match_id, person_a, person_b, winner, event
So in the matches table, person_a, person_b, and winner are integers that correspond to person_id in the Person table.
If I pull in a row from Matches table, it would come out like this:
1, 1, 2, 1, Chess Tournament #33
How can I lookup those 3 fields (person_a, person_b, and winner) with the Person table to pull in their actual names so that the result is?
1, John, Steven, John, Chess Tournament #33
I looked into joining the two tables, but it doesn’t makes sense because I can’t just do ON id=id, or WHERE id=id. I appreciate any help.
1 Answer