database - How to remove duplicate rows keeping other unique rows alive? -
this question has answer here:
- sql delete duplicates in table 3 answers
below records table contains. want remove duplicate rows , result must contain rows having ids 50, 10, 20, 30, 40.
thanks
50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 50 engineering pune 10 accounting new york 20 research dallas 30 sales chicago 40 operations boston
the different thing between same rows in oracle rows got unique rowid there can use min or max of rowid group columns query this:
delete tablename rowid not in (select max (rowid) tablename group id, name, place );
Comments
Post a Comment