I need write select script that checks if column is null then shows "is null" value, when column is not null then shows "is not null" value in output. But I should use only nvl, decode or coalesce functions. Using another functionalities is not allowed.

1

There are 1 best solutions below

1
Littlefoot On

Decode is quite simple:

select decode(column_name, null, 'is null',
                                 'is not null'
             ) as result
from your_table

I don't see why (or how) should NVL and coalesce be involved here, their purpose is different. Maybe you could use them, but - that would be unnecessarily complicated.