Search Postgresql Archives

Overlapping ranges

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

 



I have a large table of access logs to an application.  

I want is to find all rows that overlap startdate and enddate with any
other rows.

The query below seems to work, but does not finish unless I specify a
single id.  

select distinct a1.id
from t_access a1, 
        t_access a2 
where tstzrange(a1.startdate, a1.enddate) && 
      tstzrange(a2.startdate, a2.enddate) 





[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