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 / honey
with myCTE as(
select row_number() over( partition by empname order by
empname) as myCount from Employee
)delete from myCTE where myCount >1
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
what is hash nonclustered index
How does a profiler work?
What is the xml datatype?
Does sql server use java?
Define cursor locking
What are cursors in ms sql server?
Can we store videos inside the sql server table?
Define full outer join?
what protocol both networks use? : Sql server database administration
What is a recursive stored procedure in sql server?
How do triggers work?
Explain partitioned view?
Will count(column) include columns with null values in its count?
What are different types of table joins?