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 to edit table in sql server 2017?
How to loop through returning rows?
What is difference between equi join and natural join?
explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration
How can you know if the row fetched from cursor is still valid in underlying table?
What are the difference between data mart and data warehouse? : sql server analysis services, ssas
Explain a join?
What are the difference between primary keys and foreign keys?
How to connect Azure federated root database and apply federation in entity framework?
Which joins are sql server default?
How to create a login account in ms sql server to access the database engine using "create login" statements?
How to change the ownership of a schema in ms sql server?
How to rename databases in ms sql server?
Why I am getting "the microsoft .net framework 2.0 in not installed" message?
How to select an exiting database using mssql_select_db()?