Reputation: 29
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.
Upvotes: -1
Views: 62
Reputation: 143133
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.
Upvotes: 0