database - How to remove duplicate rows keeping other unique rows alive? -


this question has answer here:

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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -