Inner joining multiple columns to one ID [duplicate]
Inner joining multiple columns to one ID [duplicate] This question already has an answer here: I'm not in charge of the database so I can't change the format, I realize it is a horrible database. I have two tables I want to join: Table1: address_book id | name | address | phone number | email Table2: team id | person1_id | person2_id | person3_id | person4_id | person5_id | person6_id I would like to join all the personX_id with the name from address_book. I can't seem to figure out how to join more than one column. Hoping someone here could help! Thanks This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Answer 1 if you have only 6 colums for person_id you could use a multiple join select a1.name from team t left join address_book a1 on a1.name = t.person1_id left join address_book a2...