Hi I am working through example #7 from the sql zoo tutorial: SELECT within SELECT. In the following question
\"Find each country that belongs to a continent where all p
why use a sub query?
try using:
SELECT name, continent, population FROM world
WHERE population > 25000000
and/or
SELECT name, continent, population FROM world
WHERE population <= 25000000
the column of your condition: "population" is in the FROM
table: "world". There is no need to use a sub query of the same table "world" again, just use the "population" column directly in the WHERE
or are you trying to do this:
SELECT name, continent, population FROM world
WHERE continent NOT IN (
SELECT continent FROM world
GROUP BY continent
HAVING SUM(population) > 25000000)
notice the: SUM(), GROUP BY, and HAVING