Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Database Administration >> Deleting Duplicate Records

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Deleting Duplicate Records
 sm_ahmeds  Posted: Apr 25, 2007 02:42:44 PM

 Total Post: 53
 Joined: Apr, 2007






 Hi.....one more query....please post how to delete the duplicate rows from a table without disturbing the connected users

Thank U

 Ratnaker
Posted: Apr 26, 2007 03:52:04 AM  

 Total Post: 141
 Joined: Apr, 2007






 
Hi Ahmed,

u can delete duplicate row from table using given below the query

DELETE FROM table A WHERE ROWID > (
SELECT min(rowid) FROM table B
WHERE A.id = B.id);

Ratnaker


 sm_ahmeds
Posted: Apr 26, 2007 09:58:15 AM  

 Total Post: 53
 Joined: Apr, 2007






 
Thanks Ratnakar

 sm_ahmeds
Posted: Apr 29, 2007 01:53:17 PM  

 Total Post: 53
 Joined: Apr, 2007






 
This query is not working...its giving o rows deleted. I want to delete the duplicate rows from the same table please help.

Thanks

 vikhardba
Posted: May 03, 2007 10:18:57 AM  

 Total Post: 86
 Joined: Apr, 2007






 
Hai Ahmed!!

I hope you are striving hard for Oracle. I hope this query is helpful to delete duplicate rows from the table ( ex: dept )

delete from dept t1 where rowid>(select min(rowid) from dept t2 where t1.deptno=t2.deptno);

I hope this exact example will help you to clarify ur issue.

Regards,
Mohammed Vikhar Ahmed.

 swinal
Posted: Jul 07, 2007 10:27:30 AM  

 Total Post: 4
 Joined: Jul, 2007






 
hi
i hope this query will help u.
Suppose table name is "table1" and it has two Colms T1 and T2


DELETE FROM table1
WHERE ROWID NOT IN (SELECT min(rowid)
FROM table 1
GROUP BY T1,T2)


 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi335
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software