Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem in comparison of two way records in table

Re: Problem in comparison of two way records in table

From: Dmitry E. Loginov <lde_at_mpsb.ru>
Date: Fri, 3 Jun 2005 10:26:48 +0400
Message-ID: <d7ot5c$65u$1@news.caravan.ru>


<kalgill_at_talk21.com> wrote in message
news:1117720734.699958.98390_at_g49g2000cwa.googlegroups.com...
> Hi All,
>
> I have a problem with a table whereby everytime a record is created
> another is created showing the opposite of this:
<...>
> Rel_Id (PK)|Source_Id|To_Id|Start_Date|End Date
> R1 |P1 |P2 |2005-01-05|2005-02-05
> R3 |P2 |P1 |2005-01-05|2005-02-05
>

<...>
> What I need is to create a SQL script which finds those rows where the
> corresponding opposite row has not been created.
<...>
Use set operator "minus":

select Source_ID, To_Id, Start_Date, End_Date from YourTable minus
select To_Id, Source_ID, Start_Date, End_Date from YourTable Received on Fri Jun 03 2005 - 01:26:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US