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: SQL Query with only Duplicates...

Re: SQL Query with only Duplicates...

From: Jon Yi <joycompu_at_yahoo.com>
Date: Fri, 01 Nov 2002 22:29:44 GMT
Message-ID: <sfDw9.2473$7W2.2253@nwrddc01.gnilink.net>

"Logan Yserver" <gollum211_at_nospam.hotmail.com> wrote in message news:slrnas5n4o.rbm.gollum211_at_sith.adm.louisville.edu...
> In article <vnhw9.11508$IU6.7174_at_nwrddc03.gnilink.net>, Jon Yi wrote:
> >
> > "Logan Yserver" <gollum211_at_nospam.hotmail.com> wrote in message
> > news:slrnas34ts.983.gollum211_at_sith.adm.louisville.edu...
> >> In article <3DC1819F.1C69863D_at_exesolutions.com>, Daniel Morgan wrote:
> >> > Logan Yserver wrote:
> >> >>
> >> >> EID PCN DID
> >> >> ---- ---- --------
> >> >> 1000 0070 21212121
> >> >> 1001 0080 32323232
> >> >> 1001 0020 43434343
> >> >> 1020 0080 65656565
> >> >> 1020 0080 76767676
> >> >> 1020 0010 10101010
> >> >>
> >> >>
> >> >> EID PCN DID
> >> >> ---- ---- --------
> >> >> 1020 0080 65656565
> >> >> 1020 0080 76767676
> >> >>
> >>
> >
> > Try these. It implements exactly what you said.
> >
> > select eid, pcn, did
> > from mytable where (eid, pcn) in (
> > select a.eid, a.pcn
> > from mytable a, mytable b
> > where a.eid = b.eid and
> > a.pcn= b.pcn and
> > a.did <> b.did );
> >
> > Here is the output
> > 1020 0080 65656565
> > 1020 0080 76767676
> >

>

> Jon,

>
> That did it... Only a few abnomilies in my data where we have 3 lines
output
> but two are exactly the same. But this is what I needed. Thanks!
>
It is nice to be helpful and be thanked. If you must eliminate identical rows, just add "distinct" after select. It should work.
-
Jon Yi Received on Fri Nov 01 2002 - 16:29:44 CST

Original text of this message

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