SQL學習中的疑問


下面是我學習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))

有沒有更簡單的寫法?



注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com