Https://www.codecademy.com/practice/projects/world-populations-sql-practice-ii

**SQL commands ‘with’ ‘join’ and ‘where’ are in a conflict when they be used together, Why? **

MY CODE:

WITH OceaniaCountries AS (
SELECT id
FROM countries
WHERE continent = ‘Oceania’)
SELECT SUM(population)
FROM population_years
JOIN OceaniaCountries
ON population_years.country_id = OceaniaCountries.id;
WHERE population_years.year = 2005
;
It running well with or without the ‘where’ clause, accordingly ‘where’ clause doesn’t work.
WHY? I want to increase efficiency by using the ‘with’ clause.

THE GIVEN SOLUTION:
SELECT SUM(population)
FROM population_years
INNER JOIN countries
ON countries.id = population_years.country_id
WHERE year = 2005
AND continent = ‘Oceania’;

https://www.codecademy.com/practice/projects/world-populations-sql-practice-ii