Rahmadnet

PL/pgSQL CASE statement

Jul 29th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.     text
  3.         (
  4.             case age
  5.             when 24  then
  6.             'Rahmad'
  7.             else
  8.             'uknow'
  9.             end
  10.         ) as "24",
  11.     text
  12.         (
  13.             case age
  14.             when 19 then
  15.             'Rahmadi'
  16.             else
  17.             'Andari'
  18.             end
  19.         ) as "19",
  20.     text
  21.         (
  22.             case age
  23.             when 21 then
  24.             'Wandi'
  25.             else
  26.             'uknow'
  27.             end
  28.         ) as "21",
  29.     text
  30.         (
  31.             case age
  32.             when 22 then
  33.             'Wildan'
  34.             else
  35.             'uknow'
  36.             end
  37.         ) as "22"
  38.     from employe;
Advertisement
Add Comment
Please, Sign In to add comment