我遇到了问题;
给定 CITY 和 COUNTRY 表,查询 CONTINENT 为“Africa”的所有城市的名称。
注意:CITY.CountryCode 和 COUNTRY.Code 是匹配的键列。
解决方案是;
SELECT city.NAME
FROM city
INNER JOIN country
ON city.CountryCode = country.Code
WHERE country.continent = 'Africa';
但我不明白为什么写“city.Name”而不是“NAME” 以及为什么“ınner joın”是由 writen “ON city.CountryCode = country.Code”执行的 为什么“ON city.POPULATION = country.POPULATION”和“ON city.NAME = country.NAME”的用法不起作用?
解决方案是;
SELECT city.NAME 从城市 INNER JOIN 国家 ON city.CountryCode = country.Code WHERE country.continent = '非洲';
但我不明白为什么写“city.Name”而不是“NAME” 以及为什么“ınner joın”是由 writen “ON city.CountryCode = country.Code”执行的 为什么“ON city.POPULATION = country.POPULATION”和“ON city.NAME = country.NAME”的用法不起作用?