Search Postgresql Archives

Getting the amount of overlap when using OVERLAPS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Given 2 date ranges, the overlaps functions returns TRUE or FALSE. I
want to find the # of days that are overlapping. Is there a "built in"
way to do this?  Should I just write a function to do it?

For instance, this example overlaps, but I want to know how much does
it overlap?

SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS
       (DATE '2001-10-30', DATE '2002-10-30');

Thanks in advance!
Tony Wasson

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux