As in DB2, empty string and null are unlike in Oracle. Is there any method to realize NVL but with empty string?
Advertisement
Answer
You could combine it with NULLIF
:
The NULLIF function returns the null value if the two arguments are equal; otherwise, it returns the value of the first argument.
SELECT NVL(NULLIF(col, ''),'replacement')