标签:ima least sans amp rac font section chm 答案
This tutorial is about aggregate functions such as COUNT, SUM and AVG. An aggregate function takes many values and delivers just one value. For example the function SUM would aggregate the values 2, 4 and 5 to deliver the single value 11.
name | continent | area | population | gdp |
---|---|---|---|---|
Afghanistan | Asia | 652230 | 25500100 | 20343000000 |
Albania | Europe | 28748 | 2831741 | 12960000000 |
Algeria | Africa | 2381741 | 37100000 | 188681000000 |
Andorra | Europe | 468 | 78115 | 3712000000 |
Angola | Africa | 1246700 | 20609294 | 100990000000 |
... |
SELECT SUM(population) FROM world
select DISTINCT(continent) from world
SELECT SUM(gdp) FROM world where continent=‘Africa‘
select count(name) from world where area>1000000
SELECT SUM(population) FROM world where name in(‘France‘,‘Germany‘,‘Spain‘)
select continent,count(name) from world group by continent
select continent,count(name) from world where population>= 10000000 group by continent
select continent from world group by continent having sum(population)>=100000000
标签:ima least sans amp rac font section chm 答案
原文地址:http://www.cnblogs.com/yangykaifa/p/7295604.html