Write a query to delete duplicate records in SQL SERVER
Answer Posted / vinod singh kushwah
Delete From Tablename where(ID Not in (Select max(ID) from
Tablename Group by name))
Tablename :Friend
ID Name Age city
101 vinod 22 Gwalior
102 Pritesh 23 Gwalior
102 Pritesh 23 Gwalior
103 Arvind 24 Gwalior
Here Id-102 is repeated so friend if u want to delete this
duplicate raw Try Above code in Sql-sever
| Is This Answer Correct ? | 4 Yes | 13 No |
Post New Answer View All Answers
How do you identify a foreign key?
What is ms sql server service broker?
What is store procedure? How do they work? When do you use?
Explain logical operators in sql server?
What do you mean by tablesample?
Difference between DELETE and TRUNCATE?
What is the difference between cartesian product and cross join?
How to enforce security in sql server? : sql server security
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
What is user-defined functions? What are the types of user-defined functions that can be created?
What is sql profiler. What are the default templates with it? : sql server database administration
Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
What methods do you follow to protect from sql injection attack?
Explain what is the main purpose of having conversation group?
Describe and explain about SQL native client?