[英]Oracle Sql case statement with Multiple values in then
我想編寫具有多個 output 值的多個條件的 oracle sql 案例。
例如,
SELECT A,B,
Case
When A In(default, non default, Deliquent) Then ('dl_vint','lw_vint','hg_vint')
from Application
SQL 查詢支持case
表達式。 表達式返回單個值。 我假設你想要這樣的東西:
select A, B,
(case when A = 'default' then 'dl_vint'
when A = 'non default' then 'lw_vint'
when A = 'Deliquent' then 'hg_vint'
end)
from Application
像這樣
SELECT
A, B,
case A
when 'default' THEN 'dl_vint'
when 'non default' then 'lw_vint'
when 'Deliquent' then 'hg_vint'
end
from Application
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.