Re: How to select overlap records?

From: Eugenio <eugenio.spadafora_nospam_at_compaq.com>
Date: 2000/07/13
Message-ID: <8kjq8v$9p9$1_at_mailint03.im.hou.compaq.com>#1/1


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>...

>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
>
>
>
>
Received on Thu Jul 13 2000 - 00:00:00 CEST

Original text of this message