0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Redshift】CASE式の入れ子はできるか?

Posted at

実験

表題に書いたように、CASE式の中のWHEN句の中でさらにCASE式を書いても正常に動作するかどうかを実験

結果

下記クエリで実験し、正常に動作することを確認。

select
    case
        when a = 1 then
            case
                when b = 2 then 'a'
                else 'b'
                end
        else 'c'
        end
from (
    select
        1 as a,
        2 as b
)

結論

表題の結論:可能

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?