-1

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.

  • Please, show your current attempt and describe what is the issue with it. These functions are [well-documented with examples](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/DECODE.html#GUID-39341D91-3442-4730-BD34-D3CF5D4701CE). StackOverflow is not a codewriting service. – astentx Oct 28 '22 at 07:17

1 Answers1

0

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.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • 1
    I guess this was just homework and unfortunately, you just did it for him/her which is the opposite of homework's idea ;) – Jonas Metzler Oct 28 '22 at 07:01