簡體   English   中英

Spotfire-什么是Oracle Decode?

[英]Spotfire - what is the equivalent of Oracle Decode?

我正在嘗試復制以下內容:

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


blah table being:
name
salary
job

是否有等效的解碼或if或switch之類的東西?

嘗試:

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

如果job是一個整數,則需要將其轉換為字符串:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM