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: 7065
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: Tue Apr 23 06:59:00 CDT 2024