塔布市
id_city city
1 Paris
2 Texas
3 Toquio
选项卡\u控件
id_control origin destination
1 1 3
对于前面的表,我需要从tab\u控件获取数据,并从tab\u city获取相应的城市。
如果只是起源很简单:
SELECT origin.tco, city.tci
FROM tab_control tco
LEFT JOIN tab_city tci ON tco.origin = tci.id_city
返回
origin = 1
city = Paris
但是,我需要
origin = 1
city = Paris
destination = 3
city_destination?? = Toquio
1条答案
按热度按时间mzmfm0qo1#
你需要再来一杯
JOIN
目的地