下面是我学习SQL语句中的出错的和疑问,算是总结。
8. Exclusive OR (XOR). Show the countries that are big by area or big by population but not both. Show name, population and area.(来自在线SQL练习网站)
- Australia has a big area but a small population, it should be included.
- Indonesia has a big population but a small area, it should be included.
- China has a big population and big area, it should be excluded.
- United Kingdom has a small population and a small area, it should be excluded.
SELECT name,population,area FROM world
WHERE ((area < 3000000 and population>250000000) OR (area > 3000000 and population < 250000000))
有没有更简单的写法?