Oracle deleting duplicates based on a condition
问题 I am trying to delete some duplicates out of a table and trying to retain one of the duplicates for ID1 column. Using this query I managed to delete based on ROWID. delete from tabela.lorik where ROWID not in ( select MAX(ROWID) from tabela.lorik GROUP BY ID1) Now I want to delete all those records found duplicate where NETAMT = 0 回答1: You can achieve this using the following query: delete from tabela.lorik O where O.netamt = 0 AND EXISTS (SELECT 1 FROM tabela.lorik I WHERE I.ID = O.ID AND I