[Solved] join in table for multiple column [closed]


As you have three different foreign keys, you need to do 3 different joins with the same table:

SELECT table1.name AS 'id_name',
       first.name AS 'id1_name',
       second.name AS 'id2_name'
FROM table2
    JOIN table1 ON
        table1.id = table2.id
    JOIN table1 first ON
        first.id = table2.id1
    JOIN table1 second ON
        second.id = table2.id2

2

solved join in table for multiple column [closed]