赞
踩
以下题目均来自sql zoo
select sum(population) from world
select distinct(continent) from world
解:distinct用来查询不重复记录的条数
select sum(gdp) from world where continent = 'africa'
select count(name) from world where area >=1000000
解:COUNT() 函数返回匹配指定条件的行数
- select sum(population) from world where name in
- ('Estonia', 'Latvia', 'Lithuania')
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。