Write a query to delete duplicate records in SQL SERVER
Answer Posted / deepak raheja
DELETE FROM A
WHERE (id NOT IN
(SELECT MAX(ID)
FROM A
GROUP BY name))
suppose i have table called A. A has two coloumn id
(identity) as int and Name as nvarchar. I have data like
this.
id Name
1 C
2 D
3 C
4 E
5 D
6 D
| Is This Answer Correct ? | 78 Yes | 57 No |
Post New Answer View All Answers
Can you import Microsoft Excel data to SSRS?
what is denormalization? : Sql server database administration
What is the process of normalization?
Explain how to integrate the ssrs reports in application?
What do you mean by SQL injection attack?
What is difference between delete and truncate commands?
What is the contrast between sql and mysql?
query processing
What is the tcp/ip port on which sql server runs?
How to list all columns in a table using odbc_columns()?
What is the use of toad or sqldbx.?
How would you choose between a clustered and a non-clustered index?
What does executeupdate return?
How can windows applications connect to sql servers via odbc?
What are distributed partitioned views?