Wednesday, September 7, 2011

NVL (oracle) & coalesce (postgresql) functions

I've used the NVL (that stands for null value) function before, it provides a pretty useful service : if one field in our query returns a null, it replaces that null value for another value you specify, and this comes particularly handy when filling a table that doesn't allow null values.

The equivalent in postgresql is the coalesce function:

As with everything else, overuse may injure, if used without an analysis of those null values (IMHO).


No comments:

Post a Comment