PL/SQL Find & Delete Duplicate Records

SELECT
select *
  from
    (
      select d.*
      , count(*) over
      (partition by adi) cnt
      from ort_ilce_kodlari d
    )
where cnt > 1;

DELETE
delete from ort_ilce_kodlari a
       where rowid >
        (
          select min(rowid)
          from ort_ilce_kodlari b
          where a.adi = b.adi
        );

Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"