Say I have the following tables:
================
table_one
================
- table_one_id (PK)
- field_1
- field_2
================
table_map
================
- table_one_id
- table_two_id
================
table_two
================
- table_two_id (PK)
- field_1
- field_2
Given the value table_two_id, I need all the records in table_one joined with the columns in table_two WHERE table_one->table_one_id = table_map->table_one_id, table_map->table_two_id = table_two->table_two_id.
SELECT t1.field_1 as t1_field1, t2.field_1 as t2_field2 FROM table_one t1, table_map m, table_two t2 WHERE m.table_two_id=123 AND t1.table_one_id=m.table_one_id AND t2.table_two_id=m.table_two_idSomething like that will give you access to the first field in both tables, simply extend to which fields you want