CREATE OR REPLACE PROCEDURE PR_MOD_BASE IS cursor c_base IS SELECT MIN(INVENTORY_DATE) IDATE,KUNNR,MATNR FROM STOCK_BASE_DATA GROUP BY TO_CHAR(INVENTORY_DATE,'yyyy-MM-dd'), KUNNR,MATNR HAVING count(*) > 1; c_row c_base%rowtype; BEGIN FOR c_row in c_base loop DELETE FROM STOCK_BASE_DATA WHERE INVENTORY_DATE = c_row.IDATE and KUNNR = c_row.KUNNR and MATNR = c_row.MATNR; end loop; COMMIT; END;