Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query with only Duplicates...
"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
> >
>