This is a discussion on How to delete duplicate rows from a table within the Oracle Tutorials forums, part of the Articles and Tutorials category; Hi friends, can any body please tell me how can i delete duplicate records from a table . If the ...
|
|||||||
|
|||
|
How to delete duplicate rows from a table
Hi friends,
can any body please tell me how can i delete duplicate records from a table . If the table I have is with the following data SNO SNAME -------------------------------- 1001 ATHER 1001 ATHER 1001 ATHER 1001 ATHER 1001 ATHER is it possible to delete 4 records and keep any one record, plese reply if someone has answer. Thanx& Regards Ather |
| Sponsored Links |
|
|||
|
To delete Duplicate rows In a table
Hi Ather,
Assuming the table name as TEST with data in it as. SNO SNAME ---- --------- 1001 ATHER 1001 ATHER 1001 ATHER 1001 ATHER 1001 ATHER Query to delete duplicate records can be written as given below SQL> delete from test a where rowid <> ( select max(rowid) from test b where a.sno = b.sno and a.sname = b.sname ) Hope it helps Thnx&Regards Kevin |
|
|||
|
Deleting Duplicate records
Hi,
Try this out SELECT sno, COUNT(sno) AS NumOccurrences FROM <tblname> GROUP BY sno HAVING ( COUNT(sno) > 1 ) Quote:
|
|
|||
|
how to delete duplicate rows from the following table
hi guys, i would like to know how to write a query to delete duplicate rows from the below table, friends reply me pls
KNO KNAME ---- ------- 555 ssss 333 dddd 555 ssss 333 dddd 555 ssss 333 dddd |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|