NVL is not a simplified form of COALESCE

  • Try this:



    According to Oracle documentation, both should yield the same results. However, while COALESCE evaluates all branches until it finds one that is not NULL, NVL allways evaluates both branches, resulting in an error on the second statement (division by zero).

  • I just wanted to reply so that this and its related thread don't go unacknowledged.  Keep up the good work, I personally hate Oracle just for the empty string vs null issue, it's nice to know that there are plenty of other good reasons.

Log in to reply

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.