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 -> Problem in comparison of two way records in table

Problem in comparison of two way records in table

From: <kalgill_at_talk21.com>
Date: 2 Jun 2005 06:58:54 -0700
Message-ID: <1117720734.699958.98390@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:

e.g.

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

The Rel_Id is a PK but is not nessarily created incrementally.

For some unknown reason in some instances only one of the rows have been created either the first or the second.

What I need is to create a SQL script which finds those rows where the corresponding opposite row has not been created.

I have tried, nested loops, joins everything I can think of, but maybe I am looking this the wrong way.

The oracle environment I am using is (I am at a client site): Oracle7 Server Release 7.3.3.0.0 - Production Release

Kind Regards,

Kal Received on Thu Jun 02 2005 - 08:58:54 CDT

Original text of this message

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