Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to select overlap records?
Michael, try this one
select a.FROM_LENGTH, a.TO_LENGTH, b.FROM_LENGTH, b.TO_LENGTH
from yourtable a, yourtable b
where a.rowid != b.rowid
and ((a.FROM_LENGTH between b.FROM_LENGTH AND b.TO_LENGTH)
OR (a.FROM_LENGTH between b.FROM_LENGTH AND b.TO_LENGTH))
-- be happy Eugenio remove _nospam from reply address Opinions are mine and do not necessarily reflect those of my company ======================================================= Michael wrote in message <8kh6h6$1eqr$1_at_news.cz.js.cn>...Received on Thu Jul 13 2000 - 00:00:00 CDT
>Hi, I want to select overlap records in one select statement.
>The table content like this:
>
>FROM_LENGTH TO_LENGTH
>-------------- ----------------
>1 100 (record 1)
>101 200 (record 2)
>150 300 (record 3)
>
>Then record 2 and 3 are overlapping. But how can I select them out.
>
>Thanks
>
>Michael
>
>
>
>
![]() |
![]() |