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

Difference between report and query parameter. Why do we need different type of parameter?

565


What is the xml datatype?

619


How to find out the list schema name and table name for the database?

524


If user is owning any SQL Objects, can we drop that user

1602


What are group functions in query statements in ms sql server?

550






Where do you find the default Index fill factor and how to change it?

597


Why and when do stored procedure recompile?

546


What are cursors and when they are useful?

574


What are Row versions of DataRow?

604


What does set rowcount do?

508


What is the sql server agent?

580


What is the difference between function and stored procedure in sql server?

482


what is new philosophy for database devises for sql server 7.0? : Sql server database administration

515


How many primary keys are possible in a table?

515


What are the lambda triggers?

483