Home » Other » Training & Certification » non-duplicate rows
icon3.gif  non-duplicate rows [message #271883] Wed, 03 October 2007 05:02 Go to next message
ap_karthi
Messages: 87
Registered: October 2007
Location: Bangalore
Member
Hi,

To delete duplicate rows,

Delete from emp e where rowid < (select max(rowid) from emp e1
where e1.empno = e.empno).

My questions is...HOW TO DELETE NON-DUPLICATE RECORDS ?

Query pls...thank you.

bye
karthik
Re: non-duplicate rows [message #271886 is a reply to message #271883] Wed, 03 October 2007 05:10 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
One way:
DELETE FROM yourtable 
WHERE  nondup_columns IN ( SELECT nondup_columns
                       FROM   yourtable
                       GROUP  BY nondup_columns
                       HAVING count(*) = 1
                     )
MHE

[Updated on: Wed, 03 October 2007 05:10]

Report message to a moderator

Re: non-duplicate rows [message #271888 is a reply to message #271886] Wed, 03 October 2007 05:13 Go to previous message
ap_karthi
Messages: 87
Registered: October 2007
Location: Bangalore
Member
It works fine...Thanks...
Previous Topic: ocp(developer)
Next Topic: What will be the Cost of OCA Certification for delow items
Goto Forum:
  


Current Time: Wed Dec 07 10:26:03 CST 2016

Total time taken to generate the page: 0.06137 seconds