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
How to declare a cursor with "declare ... Cursor" in ms sql server?
Explain the relational database management system (rdbms)?
What are basics of policy management?
Can another user execute your local temporary stored procedures?
Define synonym?
How to change the ownership of a schema in ms sql server?
What is create statement?
Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?
What is a ddl statement?
How will you go about resolving deadlocks?
explain different types of cursors? : Sql server database administration
What is a with(nolock)?
What does truncate do?
how many type of indexing in database?
what is the system function to get the current user's user id? : Sql server database administration