how to delete duplicate rows from table in sql server
Answer Posted / eashwar v
IN SQL SERVER 2005, This can be easily achieved without
crating unique identifier by using CTE and ROW_NUMBER (),
the modified query for sql server 2005 goes here
***********************************************
WITH T1 AS (SELECT ROW_NUMBER ( ) OVER ( PARTITION BY ID,
FNAME, LNAME ORDER BY ID ) AS RNUM FROM DUPLICATE )
DELETE FROM T1 WHERE RNUM > 1
***********************************************
To get a detail grasp on ROW_NUMBER () OVER () … Refer MSDN
http://msdn2.microsoft.com/en-us/library/ms186734.aspx for.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why I am getting this error when renaming a database in ms sql server?
Explain the difference between cross join and full outer join?
How to manipulate data from one table to another table ?
What is the process of indexing?
What do you understand by SQL*Net?
How many databases instances are there in sql server 2000?
What are the new features in sql server 2016?
What is left outer join in sql server joins?
Please illustrate physical database architecture? : SQL Server Architecture
tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
How can we rewrite sub-queries into simple select statements or with joins?
Find nth lowest salary or get nth lowest salary?
Give an example of SQL injection attack ?
What is the difference between varchar and varchar(max) datatypes?
What is an example of a primary key?