Assuming that I have a sql table named table_1 that has two columns named "ref_1_id" and "ref_2_id" which both reference table_2:
table1: (id, ref_1_id, ref_2_id)
and inside table_2, I have a reference to table_3 as ref_3_id:
table_2: (id, ref_3_id)
and in table_3 I have a col named as cost
:
table_3: (id, cost)
I would like to write a sql query to fetch table_1 id as well as the cost fetched from table_3 corresponding to both ref_1_id and ref_2_id: (table_1_id, cost_1, cost_2)