Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Please help write a query **Urgent** tks
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
![]() |
![]() |