【发布时间】:2020-05-20 15:36:58
【问题描述】:
我创建了以下选择查询,以使用 CASE-WHEN-THEN 根据 if then else 显示数据
select id,name,
case
when rating between 4.0 and 5 then "very good"
when rating between 3.0 and 3.5 the "good"
else "Good Resort"
end as comment
from resort
order by id;
执行时会给出这个
错误
ORA-00904:“Good Resort”:标识符无效
【问题讨论】:
-
用单引号括住字符串,而不是双引号。