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
What is difference between joins and subqueries?
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
How do database indexes work?
What is the maximum size of a dimension? : sql server analysis services, ssas
Name 3 ways to get an accurate count of the number of records in a table?
What does indexation mean?
What are the different authentication modes in sql server? How can it be changed?
How to create dbo table in sql server?
What language is sql server written in?
What is shrink log file?
Explain the database you used in your final year project?
Does group by or order by come first?
What is filestream?
How to specify the collation for a character data type in ms sql server?
What is a bit datatype?