[Oracle]三元運算/ifelse

  • 827
  • 0

Oracle/SQL Server/三元運算/ifelse

查詢BOOKS書名,空值呈顯1,有值呈顯2
select (CASE WHEN BOOKNAME is NULL THEN '1' ELSE '2' END ) as BN from BOOKS