以下语句完美运行
select case when person ="name1" then "nickname1"
when person="name2" then "nickname2"
else person end as name
from person;
但它因以下语句的 IF ELSE 而失败
select if person ="name1" then "nickname1"
else person end as name
from person;
(IF-THEN-ELSE) 和 (CASE-WHEN-THEN-ELSE-END) 之间有什么区别?还有一个是我们是否有 IF-THEN=-ELSE 的“CASE”语句。