Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Duplicated Row Queries
Hi,
On Wed, 1 Mar 2000 12:22:25 +0100, Niels Lippke <c0032019_at_tu-bs.de> wrote:
>On Wed, 1 Mar 2000, Tom Zamani wrote:
>
>> well,
>> Consider that you have a table like
>> create table MyTab(
>> name varchar2(6)
>> address varchar2(10)
>> );
>> insert into MyTab values('You','There');
>> insert into MyTab values('Me','Here');
>> insert into MyTab values('Me','Here');
>>
>> select a.name, a.address from MyTab a, MyTab b
>> where a.name=b.name and
>> a.address=b.address and
>> a.rowid<>b.rowid
>
>You surely can do this with small tables. But in my case, the table
>consists of approx. 10 columns and approx. 20.000 rows.
>I tried this statement before, but after 10 minutes of no result, I gave
>up waiting.
>I'm sure that there's an easier way.
Try this or similar (not tested):
select
qSub.name, qSub.address
from
(
select
name, address, count(*) reccount
from
MyTab
group by
name, address
) qSub
where
qSub.reccount > 1;
Kind regards,
Richard
-- Richard Willemsen ---- http://www.xs4all.nl/~rwillems/ mailto:richard.willemsen_at_xs4all.nlReceived on Wed Mar 01 2000 - 00:00:00 CST