「Oracle」カラム値がnullの判定方法

1.CASE構文

SELECT
  CASE 
    WHEN NOTE IS NULL THEN 0 
    ELSE 1 
  END AS CFT
FROM
  USER_TBL

2.NVL2関数

SELECT
NVL2(NOTE, 1, 0) AS CFT
FROM
USER_TBL

3.DECODE関数

SELECT
DECODE(NOTE, NULL, 0, 1) AS CFT
FROM
USER_TBL

 

Oracle

Posted by arkgame