Suppose I have 2 such tables. The fields risk1_id, risk2_id, risk3_id are associated (FOREIGN KEY) with the id field from (the first table) let's say this is the table of risks. table risks table with fields risk1_id, risk2_id, risk3_id

And you need to link the tables by the id, risk1_id, risk2_id, risk3_id fields. Yes, I know that for good you need another table.

    1 answer 1

    I think you need to make 3 separate requests and merge them through UNION

     JOIN по risk1_id UNION JOIN по risk2_id UNION JOIN по risk3_id