how to delete duplicate rows from table in sql server
Answer Posted / sanjay kumar dinda
Deletion of Rows depends upon the different condition...
Consider based on n columns the entire recordset is
treating a duplicate... We can delete the duplicate by
using following method...
Add one column and set uniue values to that column..
ALTER TABLE TABLE1 ADD ID INT IDENTITY(1,1)
COnsider T contains 40 columns and based on C1,C2,C3 we
have to find the duplicate and we have to delete the same...
Delete T1
FROM TABLE1 T1,TABLE1 T2
WHETE T1.C1=T2.C1 AND
T1.C2=T2.C2 AND
T1.C3=T2.C2
AND T1.ID>T2.ID
I think this will help....
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Describe in brief authentication modes in sql server.
Create and insert into temp table in sql server?
What are types of storage modes? : sql server analysis services, ssas
What is precedence constraint?
Which joins are sql server default?
What are the essential components of sql server service broker?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
What is user-defined multi-statement table-valued function?
What is normalization of database?
What is the cartesian product of table?
How do I find query history in sql server?
Which language is supported by sql server?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
Explain important index characteristics?
Explain the stored procedure?