Delete duplicate rows from a table without primary key by
using a single query
Table Employee
empname salary
A 200
B 300
A 200
C 400
D 500
D 500
Output should be
A 200
B 300
C 400
D 500
Answer Posted / gaurav sharma
SELECT DISTINCT * INTO Employee1 FROM Employee
DROP Table Employee
sp_rename 'Employee1','Employee'
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain having clause?
What are the system database in sql server 2008?
What is instead of dml trigger?
What is raid and what are different types of raid levels?
Hi all, can any one please tell me the difference between sql server 2008 and orace 9i
What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?
Can we shrink data file in sql server?
Tell me what is the order in which the sql query is executed?
what is denormalization? : Sql server database administration
What is the boxing and unboxing concept in .net?
How to generate random numbers with the rand() function in ms sql server?
Explain the types of indexes.
Are semicolons required at the end of sql statements in sql server 2005?
Can you explain what are the restrictions applicable while creating views? : SQL Server Architecture
What is used to replicate sessions between instances in coldfusion clusters?