SELECT airline, airports.icao_code, continent, country, province, city, website
FROM airlines
FULL OUTER JOIN airports ON airlines.iaco_code = airports.iaco_code
FULL OUTER JOIN cities ON airports.city_id = cities.city_id
FULL OUTER JOIN provinces ON cities.province_id = provinces.province_id
FULL OUTER JOIN countries ON cities.country_id = countries.country_id
FULL OUTER JOIN continents ON countries.continent_id = continents.continent_id
它说
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以
airports
在第 4 行的“airlines.iaco_code = airports.iaco_code full external join”附近使用正确的语法
语法对我来说是正确的。我以前从未做过很多连接,但我需要一个表中的这些列,这些列由各种 id 交叉引用。