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
Write a program to fetch first 10 records from a file?
What do you know about system database? : SQL Server Architecture
After removing a table from database, what other related objects have to be dropped explicitly?
Can we deploy SSRS reports on our personal website?
How ssrs maintain security?
Can we use where clause in union?
How many levels of sp nesting is possible?
Where are sql server usernames and passwords stored in the sql server?
what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?
What is dbcc? Give few examples.
What is the maximum length of an alert name?
What is normalization? Describe its different types.
To which devices can a backup be created and where should these devices be located? : sql server management studio
How to provide default values to function parameters?
How we can refresh the view?