table1
out_path_id
in_path_id
other_fields
table2
id
name
location_to_id
location_from_id
car_id
other_fields
местоположение
id
name
автомобиль
id
name
table1
out_path_id
и in_path_id
относится к table2
* id
.
table2
location_to_id
и location_from_id
относятся к location
'* id
.
table2
' car_id
относятся к car
'* id
.
Можно присоединиться к table1
и table2
.
select t2out.name out_name, t2in.name in_name, t1.other_fields
from table1 t1
join table2 t2out on t2out.id=t1.out_path_id
join table2 t2in on t2in.id=t1.in_path_id
Теперь я пытаюсь продолжить объединение с location
и car
.Что я могу сделать?