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.

SQL CASE演算子

Posted at

CASE演算子に関して勉強していた際、忘れたりしたので、見直し用や備忘録として。

●CASE演算子:列の値や条件式を評価して、その結果に応じて任意の値に変換することが出来る。パターンは2通り存在する。
 ・パターン1
   CASE 評価する列や式 WHEN 値1 THEN 値1の時の返り値
          (WHEN 値2 THEN 値2の時の返り値)...
           (ELSE デフォルト値)
    END

 ・パターン2
   CASE WHEN 条件1 THEN 条件1の時の返り値
      (WHEN 条件2 THEN 条件2の時の返り値)...
      (ELSE デフォルト値)
    END

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?