「Oracle」CASE式にワイルドカードを使うサンプル

書式
カラム = case when カラム like 'xxx%’
使用例

UPDATE
      USER_TBL
SET
      UID = CASE
            WHEN UID LIKE 'D9%' THEN '10001'
            WHEN UID LIKE 'E8%' THEN '20002'
            WHEN UID LIKE 'F8%' THEN '30003'
            ELSE 'bad data'
      END

 

Oracle

Posted by arkgame