if(condition, then, else) in Oracle

后端 未结 6 2723
甜味超标
甜味超标 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 02:02

    You want to use NVL, or NVL2

    NVL(t.column, 0)
    NVL2( string1, value_if_NOT_null, value_if_null )
    

提交回复
热议问题