SQLZOO練習筆記-SUM ANDCOUNT
阿新 • • 發佈:2018-12-13
SELECT SUM(population) FROM world
select distinct continent from world
select sum(gdp) from world where continent = ‘Africa’
select count(distinct name) from world where area >= 1000000
select sum(population) from world where name in (‘Estonia’, ‘Latvia’, ‘Lithuania’)
select continent, count(distinct name) from world group by continent
select continent, count(distinct name) from world where population >= 10000000 group by continent
select continent from (select continent, sum(population) as a from world group by continent) c where a >= 100000000