Why does NVL always evaluate 2nd parameter

后端 未结 4 818
清酒与你
清酒与你 2020-12-11 16:53

Does anyone know, why Oracle\'s NVL (and NVL2) function always evaluate the second parameter, even if the first parameter is not NULL?

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 17:50

    It's always been that way, so Oracle has to keep it that way to remain backwards compatible.

    Use COALESCE instead to get the short-circuit behaviour.

提交回复
热议问题