Spotfire - Oracle解码的等价物是什么?

时间:2015-08-17 11:04:58

标签: sql spotfire

我正在尝试复制相当于:

select name, salary, decode(salary > 100, "Nice Job", job) as job
from blah...


blah table being:
name
salary
job

是否有相当于解码或if或switch或什么?

2 个答案:

答案 0 :(得分:1)

尝试:

select name, salary, case when salary > 100 then "Nice Job" else job end as job
from blah...

答案 1 :(得分:1)

如果job是整数,则需要将其转换为字符串:

select (case when salary > 100 then "Nice Job" else cast(job as varchar(255))
        end) as job