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 are the differences between decimal and float in ms sql server?
Describe how to use linked server?
What is cursor in ms sql server?
what stored procedure can you use to display the current processes? : Sql server administration
What is the difference between osql and query analyzer?
What is a synonym for manipulation?
What do you understand by check constraint in sql server?
Can sql servers link to other servers like oracle?
What the different types of Replication and why are they used?
can an order by clause be used in a creation of a view?
Where are sql server usernames and passwords stored in the sql server?
How many types of stored procedures are there in sql server?
How many levels of sp nesting is possible?
What are the main sources of data?
How many replicas are maintained for each sql azure db?