Skip to content
Advertisement

How to use between if value is not null?

Im trying to write query where im using valid_from and valid_to but those values can be null or one of them.

This is my query, so i want to return data using if both valid_from and valid_to is null, or both not null or only valid_to is null. Any suggestion how can i achive that?

Advertisement

Answer

You could just explicitly add passes for null date bounds:

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