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: Logan Yserver <gollum211_at_nospam.hotmail.com>
Date: 1 Nov 2002 20:03:24 GMT
Message-ID: <slrnas5n4o.rbm.gollum211@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!

-- 

gollum211_at_nospam.hotmail.com
[Note: Remove "nospam." hostname.]
Received on Fri Nov 01 2002 - 14:03:24 CST

Original text of this message

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