sql - Overlapping times -


i have table this:

id, timestart, timefinished 

i need find timestart begins prior timefinished, has higher id, means overlapping time.

id  timestart   timefinished 1   2014-01-01  2014-01-02 2   2014-01-02  2014-01-03 3   2014-01-02  2014-01-04 

this found in row 3. here timestart < timefinished in row 2. (or find row 2 timefinished > timestart in row 3)

try left outer join :

select t1.*   table t1        left join table t2               on t1.id > t2.id                  , t1.timestart < t2.timefinished  t2.id not null  

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -