Search Postgresql Archives

Re: Any function for calculating inersect of intervals?

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

 



Együd Csaba wrote:
Hi, wondering if exists any functions which aim to calculate intersect of two
intervals. E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2)
intersects (D3,D4) or not.

Try INTERSECTS :P

SELECT * FROM table WHERE (D1, D2) INTERSECTS (D3, D4);


Related, are there any operators/functions to test for adjacency (start of one is end of other), inclusion (interval is inside other interval) or wrapping (the inverse; interval is around other interval) of intervals?


Alban.


---------------------------(end of broadcast)--------------------------- TIP 7: 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