作为 Mondial DB 的一部分,我正在尝试回答以下问题。
-- For each country display the city with the highest population together with the number of the population.
这些表是:
国家(代码、名称、首都、省、地区、人口)
城市(名称,国家,省,经度,纬度,人口)
到目前为止,我有以下内容:
SELECT
Country.Name, MaxCity.CityName, MaxCity.Population
FROM
(SELECT
MAX(Population) AS Population,
City.Country,
City.Name AS CityName
FROM
City
GROUP BY City.Country) AS MaxCity
JOIN
Country ON Country.Code = MaxCity.Country;
这哪里出错了?