Home » SQL & PL/SQL » SQL & PL/SQL » How to checking duplicated rows and copy it !!!  () 1 Vote
How to checking duplicated rows and copy it !!! [message #239620] Tue, 22 May 2007 14:46 Go to next message
Cuong
Messages: 12
Registered: May 2007
Junior Member
Hi
I wanna check if there is any duplicated values in a column in a same table then copy them to other table?
How can i do it ?
Regard
Re: How to checking duplicated rows and copy it !!! [message #239621 is a reply to message #239620] Tue, 22 May 2007 14:48 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>How can i do it ?
by using GOOGLE
Re: How to checking duplicated rows and copy it !!! [message #239625 is a reply to message #239620] Tue, 22 May 2007 15:38 Go to previous messageGo to next message
joy_division
Messages: 4643
Registered: February 2005
Location: East Coast USA
Senior Member
Hint: use the HAVING clause.
Re: How to checking duplicated rows and copy it !!! [message #239709 is a reply to message #239620] Wed, 23 May 2007 03:01 Go to previous messageGo to next message
Cuong
Messages: 12
Registered: May 2007
Junior Member
i used google then it showed me this site Very Happy
i solved it anyway.
thankz for replying guyz
Re: How to checking duplicated rows and copy it !!! [message #239744 is a reply to message #239709] Wed, 23 May 2007 04:14 Go to previous message
mailtokkalyan
Messages: 65
Registered: December 2006
Location: Bangalore
Member

Hi,
You can solve your problem using ROWID.
for example,

employees table contain duplicate values in Employee Id column.
then you can write this query to find out the duplicates.

select e.employee_id from employees e
where rowid<>(select min(rowid) from employees
where employee_id=e.employee_id
group by employee_id);

otherwise you can use this also,

select rowid,employee_id from employees
minus
select min(rowid),employee_id
from employees group by employee_id;

[Updated on: Wed, 23 May 2007 04:15]

Report message to a moderator

Previous Topic: Trigger to execute procedure
Next Topic: next_day function help
Goto Forum:
  


Current Time: Thu Dec 08 10:37:09 CST 2016

Total time taken to generate the page: 0.08025 seconds