We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
编写一个 SQL 查询报告大国的国家名称、人口和面积。
满足下述任一条件之一,记为大国:
create table world ( name varchar(255), continent varchar(255), area int, population int, gdp bigint ); insert world values ('afghanistan', 'asia', 652230, 25500100, 2034000000), ('albania', 'europe', 28748, 2831741, 12960000000), ('algeria', 'africa', 2381741, 37100000, 188681000000), ('andorra', 'europe', 468, 78115, 3712000000), ('angola', 'africa', 1246700, 20609294, 100990000000);
select name, population, area from world where area >= 3000000 or population >= 25000000;
使用 or 连接两个条件
or
select name, population, area from world where area >= 3000000 union select name, population, area from world where population >= 25000000;
将两个条件分别查询,使用 union 将两次查询连接起来。
union
The text was updated successfully, but these errors were encountered:
No branches or pull requests
题目
编写一个 SQL 查询报告大国的国家名称、人口和面积。
满足下述任一条件之一,记为大国:
SQL:方法一
解析
使用
or
连接两个条件SQL
解析
将两个条件分别查询,使用
union
将两次查询连接起来。The text was updated successfully, but these errors were encountered: