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 is a transaction and what are acid properties? : Sql server database administration

527


How to verify a login name with sqlcmd tool?

597


What are pessimistic lock and optimistic lock?

550


how will add additional conditions in sql?

576


How to trouble shoot if unable to connect SQL Server

1482






What is a mutating table error and how can you get around it?

537


How do I create an extended event in sql server?

491


What is sqlcmd?

555


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1574


What is the datatype of rowid?

510


Where sql server usernames and passwords are stored in a sql server?

497


Is sql different from sql server?

516


What are the functions in sql server?

548


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

568


How to insert data into an existing table?

571