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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Duplicated Row Queries

Re: Duplicated Row Queries

From: <nilayo_at_my-deja.com>
Date: 2000/03/01
Message-ID: <89j42k$hsh$1@nnrp1.deja.com>#1/1

Hi,
try out
select * from table_name
where specific_column in
( select count(*), column
from table_name
group by column_name
having count(*)>1)

In article <38bd034e.12938690_at_rwillems.xs4all.nl>,   rwillems_at_xs4all.nl wrote:
> 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.nl
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Mar 01 2000 - 00:00:00 CST

Original text of this message

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