write sub query for eliminating duplicate rows using
analytical function?

Answer Posted / vyshak

delete from table where rowid not in (select max(rowid) from
table group by all column names);

or

delete (dense_rank() over(partition by all column names))dn
from table where dn>2;

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many times can we commit in a loop?

732


How to raise user-defined exception with custom sqlerrm ?

852


how to add a new column to an existing table in mysql? : Sql dba

769


What is natural join in sql?

702


What are different types of triggers?

731






If a cursor is open, how can we find in a pl/sql block?

868


how do you know the version of your mysql server? : Sql dba

681


How can triggers be used for the table auditing?

750


How would you pass hints to the sql processor?

696


What is the sql*loader? : aql loader

768


What packages are available to pl/sql developers?

801


what are the join types in tsql? : Transact sql

751


What is the use of nvl function?

858


What is the need of merge statement?

754


what is the difference between clustered and non clustered index in sql? : Sql dba

732