Skip to content
Advertisement

Handling Null in Greatest function in Oracle

I want to compare two dates from two columns and get the greatest and then compare against a date value. The two column can hold NULL values too.

For example I want the below OUTPUT.

How do I use the greatest function or if there is anything else? I am again using the output to compare against another date.

Advertisement

Answer

Use Oracle CASE... WHEN structure in your select:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement