All pastes #968551 Raw Edit

Stuff

public text v1 · immutable
·published 2008-04-03 03:07 UTC
rendered paste body
SELECT allGNP.Name, allGNP.Continent, allGNP.GNPperHead
FROM
(
	SELECT Name, Continent, GNP, Population, GNP/Population as GNPperHead
	FROM Country
	WHERE Population > 0
)
allGNP JOIN
(
	SELECT Continent, max(GNP/Population) as MaxGNPperHead
	FROM Country
	WHERE Population > 0
	GROUP by Continent
)
maxGNP
on allGNP.Continent = maxGNP.Continent
and allGNP.GNPperHead = maxGNP.MaxGNPperHead