if(condition, then, else) in Oracle

后端 未结 6 2722
甜味超标
甜味超标 2021-02-20 01:15

MySQL/MSSQL has a neat little inline if function you can use within queries to detect null values, as shown below.

SELECT

...

foo.a_field AS \"a_field\",
SELEC         


        
6条回答
  •  北恋
    北恋 (楼主)
    2021-02-20 01:59

    You want the nvl function: nvl(foo.bar, 0)

    Oracle does support various ifs and cases as well.

提交回复
热议问题