Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem in comparison of two way records in table
<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
![]() |
![]() |