how to delete duplicate rows from table in sql server
Answer Posted / debasish
while @@rowcount != 0
begin
delete top (1) test where columnname in
(
select columnname
FROM tablename
GROUP BY columnname having count(*)>1
)
end
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is bcp? When does it use?
Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?
Explain the ways to controlling cursor behavior?
List the ways in which dynamic sql can be executed?
what changed between the previous version of sql server and the current version? : Sql server database administration
How to convert character strings into numeric values?
What is an indice?
Can one drop a column from a table?
how to create “alternate row colour”?
How to create a simple stored procedure in ms sql server?
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
How to maintain a fill factor in existing indexes?
What is transact-sql ddl trigger?
What are the system database in sql server 2005?
Can I disable or restrict ssrs export formats (rendering formats)?