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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is there another way of looking at this query ?

Re: Is there another way of looking at this query ?

From: Randy <gastcom_at_sympatico.ca>
Date: 5 Jul 2006 08:06:18 -0700
Message-ID: <1152111978.545066.224640@j8g2000cwa.googlegroups.com>


Thanx Wally

What I want is the duplicates to be determined at the key level. If A.1 = B.1 then exclude the row, however, if A.1 = B.1 and A.2 <> B.2 then I still want to exclude the row. yuck.

Wally wrote:
> Randy wrote:
> > Excuse me if this question has been asked before. I want to find all
> > records that satisfy the first query AND I want all the rows that
> > satisfy the 2nd query ... that haven't already been included in the 1st
> > query.
> >
> > SELECT A.1, A.2
> > FROM A
> >
> > UNION
> >
> > SELECT B.1, B.2
> > FROM B
> > WHERE B.1 NOT IN ( SELECT A.1 FROM A )
> >
> > Is there a way of NOT re-doing the original query.
>
>
> When you use a UNION in your query it removes duplicates for you. You
> dont have to do anything extra.
Received on Wed Jul 05 2006 - 10:06:18 CDT

Original text of this message

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