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
can you instantiate a com object by using t-sql? : Sql server database administration
in the physical file layout, where should the transaction log be stored in relation to the data file?
What are the joins in sql server? : sql server database administration
What is the contrast amongst drop and truncate?
How to generate create view script on an existing view?
Can an automatic recovery be initiated by a user?
Can sub report data source be different from that of the parent report?
What does the on delete cascade option do?
What is raid? : SQL Server Architecture
What is partition, how will you implement it? : sql server analysis services, ssas
How would you use user_constraints table in DB?
What is the purpose of optimization?
Define cross join in sql server joins?
What is RAID? What are the different types of RAID configurations?
How do I connect to sql server database?