write a query to remove duplicate records without using primary key column?

Answer Posted / mathanrathinam


delete tmp from(select col1,col2,row_number over(partition by col1,col2 order by col1,col2) rownum from tablename) tmp
where rownum >1

Is This Answer Correct ?    7 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?

548


What will be the maximum number of index per table?

576


How to make a remote connection in a database?

523


What are the different types of collation sensitivity?

540


Is it possible in sql table to have more than one foreign key?

598






How to disable a login name in ms sql server?

578


What is the use of group by clause?

513


How to execute a sql statement using odbc_exec()?

559


What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

1603


Can you import Microsoft Excel data to SSRS?

89


What are the recovery models for a database?

605


How does recursive cte works in sql server?

513


Please explain go command in sql server?

581


System variable and temporary variables

1696


can a database be shrunk with users active? : Sql server administration

551