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

Home -> Community -> Usenet -> c.d.o.server -> Re: Please help write a query **Urgent** tks

Re: Please help write a query **Urgent** tks

From: Pete's <empete2000_at_yahoo.com>
Date: 31 Jul 2001 14:10:46 -0700
Message-ID: <6724a51f.0107311310.4eaea5c0@posting.google.com>

Try something like the following:

select column_name_with_duplicate_names, count(*)   from your_table_name
having count(*) > 1
group by column_name_with_duplicate_names;

After you get the duplicate names, you then could select the rowid's if need be, then delete whatever row you wish.

select column_name_with_duplicate_names,rowid   from your_table_name
 where column_name_with_duplicat_names in ('NAME1',.......);

HTH,
EP

"OCP" <mr_ocp_at_yahoo.com> wrote in message news:<F_r97.106$nF6.2620_at_newscontent-01.sprint.ca>...
> Hi
> We have a table the contains several duplicate records however each record
> is with an unique primary key, I need to write a query to see how many
> records are duplicate, there is a name field which has several duplicate
> names under separat unique id, so is there a way that I can find out how
> many such duplicate names exists in the table.
>
> Please give me some ideas - this is urgent - appreciate your help
> Mike
> mr_ocp_at_yahoo.com
Received on Tue Jul 31 2001 - 16:10:46 CDT

Original text of this message

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