I have two table like this:
table1_ride
--------
id ride id
from_which_city city id
to_city city id
table2_city
--------
id city id
name city name
What I want is when I submit query SELECT * FROM ride
I want to show me ride_id, from_which_city, to_city like
this:
1 Manchester Liverpool
instead of
1 8 3 Where 8 = ManchesterID and 3 = LiverpoolID
I tried left join
SELECT * FROM ride LEFT JOIN city ON ride.from_which_city = city.id
and it's working for from_which_city
. How to do this to work for both - from_which_city
and to_city
.
I didnt find case where left join is like: t1.b = t2.a AND t1.c = t2.a
.
Thanks in advance!