Comparing records from same table and deleting the old ones
You don't need PL/SQL for this, you can delete using a sub-query:
delete from table1 where ID in (
  select ID from (
    select ID
      ,count(*) over(partition by POSITION_NBR, EFFDT) as cnt
      from table1
    )
  where cnt &gt; 1 --more than one row matches the grouping condition
);