-
SELECT name FROM world WHERE population > ( select population from world where name = 'russia');
-
SELECT name FROM world where continent = 'Europe' AND gdp/population > ( select gdp/population from world where name = 'United Kingdom');
-
SELECT name, continent FROM world WHERE continent in (select continent from world where name = 'Argentina' or name ='Australia') order by name;
排序用 order by -
SELECT name, population FROM world WHERE population > (select population FROM world where name = 'Canada') AND population <(select population FROM world where name = 'Poland');
-
SELECT name,CONCAT(ROUND(population/(select population from world where name = 'Germany')*100 ),'%') AS population FROM world where continent = 'Europe';
CONCAT函数 -
SELECT name FROM world WHERE gdp > ALL(select gdp from world where continent = 'Europe' and gdp>0);
-
SELECT continent, name, area FROM world x WHERE area >= ALL (select area from world y where y.continent = x.continent and area>0);
-
SELECT continent,name FROM world x WHERE x.name = (select name from world y where y.continent = x.continent order by name limit 1)
-
SELECT name, continent, population FROM world x WHERE 25000000 >= all (select population from world y where y.continent = x.continent and 0 < population);
-
SELECT name, continent FROM world x WHERE population/3 >= ALL (select population from world y where y.continent = x.continent and population > 0 and y.name != x.name )