使用子查询

UPDATE country
SET Population = (
    SELECT SUM(Population)
    FROM city
    WHERE city.CountryCode = country.Code
)


把每个国家的人口设为该国各城市居民数之和。