0
I have seen this question from sql zoo select from world tutorial(13 th one)是什麼下列查詢
SELECT
name, continent,
CASE
WHEN continent = 'Oceania' THEN 'Australasia'
WHEN continent = 'Eurasia' OR name = 'Turkey' THEN 'Europe/Asia'
WHEN continent = 'Caribbean' AND name LIKE 'b%' THEN 'North America'
WHEN continent = 'Caribbean' AND name NOT LIKE 'b%' THEN 'South America'
ELSE continent
END
FROM world
ORDER BY name;
SELECT
name, continent AS 'Original Continent',
CASE WHEN continent = 'Oceania' THEN 'Australasia'
WHEN continent = 'Eurasia' OR name = 'Turkey' THEN 'Europe/Asia'
WHEN continent IN (SELECT continent FROM world
WHERE continent = 'Caribbean'
AND name LIKE 'B%') THEN 'North America'
WHEN continent IN (SELECT continent FROM world
WHERE continent = 'Caribbean'
AND name NOT LIKE 'B%') THEN 'South America'
ELSE continent
END as 'New Continent'
FROM
world
ORDER BY
name;
第一個顯示正確的結果和第二沒有什麼區別的區別?任何人都可以請回答。
OI去除外來數據庫標籤。隨意使用您實際使用的數據庫進行標記。 –
查看錶格數據,你會看到。 – jarlh