1
我試圖回答以下問題作爲Mondial DB的一部分。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;
這是哪裏出錯了?
組需要添加您可以編輯您以前的答案。 – 2013-05-06 07:37:48