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
而不是
1 8 3 Where 8 = ManchesterID and 3 = LiverpoolID
我试图与我团聚。
SELECT * FROM ride LEFT JOIN city ON ride.from_which_city = city.id
并且从_city <>/code>开始使用。 如何为两者工作——<代码>,从_city 和to_city
。
我确实发现,左派有类似之处:t1.b = t2.a 和 t1.c = t2.a
。
提前感谢!