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 is order of B+tree?
1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?
what is the different types of backups available in sql server? : Sql server database administration
Explain data warehousing in sql server?
Explain iaas, paas and saas?
What is Federation and Federation Member?
How do you send email on SQL Server?
Does full backup break log chain?
Define normalisation?
How to move database physical files in ms sql server?
What is the default port for SQL Server over a firewall?
How to restore performance issues and how to check?
What are the different Topologies in which Replication can be configured?
Explain few of the new features of sql server 2008 management studio
When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?