📜  ——一些国家的人口是任何邻国(在同一大陆)的三倍以上.给国家和大洲. - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:59.203000             🧑  作者: Mango

代码示例2
SELECT name, 
       region 
FROM   bbc x 
WHERE  population > 
       -- this sub query finds each neighbour (not including itself) and returns the max populations multiplied by 3
       (SELECT 3 * MAX(population) 
        FROM   bbc y 
        WHERE  x.region = y.region 
               AND x.name <> y.name)