0

On postgresql documentation whilst reading for date and time operations I have hard time understanding the following example:

SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS
       (DATE '2001-10-30', DATE '2002-10-30');
Result: false

I failed to understand the reason why it returns false, is it because an Interval is being passed as a parameter?

0

1 Answer 1

1

As far as I understand it, (DATE '2001-02-16', INTERVAL '100 days') is evaluated as (DATE '2001-02-16', DATE '2001-02-16' + INTERVAL '100 days')

Which in turn is the same as (DATE '2001-02-16', DATE '2001-05-27') and that obviously doesn't overlap with (DATE '2001-10-30', DATE '2002-10-30')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.