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
What happens to a statement batch if there is a compilation error?
What is mapping schema?
What is an sql server agent?
What are click through reports?
Explain the difference between control flow and data flow?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
What stored by the master?
How to check parameter value in stored procedure sql server?
When would you prefer to have a minimum number of indexes?
Describe how to use linked server?
What is pessimistic concurrency?
What is a constant or literal in ms sql server?
How do I view a stored procedure in sql server query?
What do you mean by data integrity?
What is reportserver and reportservertempdb ?