Write a query to delete duplicate records in SQL SERVER

Answer Posted / vijay

WITH INTER_TABLE(ROW, COL1) AS(
select row_number() over (partition by
COL1 order by COL1) as ROW ,COL1 from [TABLE_NAME]
)
Delete from INTER_TABLE where ROW > 1

Is This Answer Correct ?    22 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of stored procedure in sql server?

474


How to convert a numeric expression from one data type to another?

516


While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?

89


What is the rdl file?

88


What is the difference between osql and query analyzer?

554






what authentication modes does sql server support? : Sql server database administration

536


What is data source object?

561


what is a mixed extent? : Sql server administration

609


What are the types of database recovery models?

605


Can we check locks in database? If so, how can we do this lock check?

535


What is sql server profiler trace data file?

591


Why union all is faster than union?

516


When would you use a before or after trigger?

500


What is logshipping and its purpose?

573


What is the difference between push and pull subscription? : sql server replication

626