标签:beginning case 一个 http country ras tle 第一个 bean
SELECT from world篇
11.
题目:
The CASE statement shown is used to substitute North America forCaribbean in the third column.
SELECT name,
CASE WHEN continent IN (‘Asia‘,‘Europe‘) THEN ‘Eurasia‘
WHEN continent IN (‘North America‘,‘South America‘,‘Caribbean‘) THEN ‘America‘
ELSE continent END
FROM world
WHERE name LIKE ‘A%‘ OR name LIKE ‘B%‘
答案:
SELECT name,continent,
CASE WHEN continent IN (‘Eurasia‘, ‘Turkey‘)
THEN ‘Europe/Asia‘
WHEN continent = ‘Oceania‘
THEN ‘Australasia‘
WHEN continent = ‘Caribbean‘
THEN
CASE
WHEN name LIKE ‘B%‘
THEN ‘North America‘
ELSE ‘South America‘
END
ELSE continent
END
FROM world
ORDER BY name ASC;
标签:beginning case 一个 http country ras tle 第一个 bean
原文地址:http://www.cnblogs.com/pds8848/p/7102874.html