How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / lince thomas
it is very simple,,below
------------------------
select * from(
select row_number() over(partition by empname order by
empname)as rno,empname,salary from Emp1Pay)T
where T.rno>1
delete from Emp1Pay where empid=
(select empid from(select row_number() over(partition by
empname order by empname)as rno,empid
from Emp1Pay )T where T.rno>1)
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is data source object?
Explain boyce and codd normal form(bcnf)?
What is bit data type?
What is a mutating table error and how can you get around it?
What is sql server 2000 work load governor?
query processing
Do you know nested transaction?
How to optimize stored procedures in sql server?
How to convert numeric expression data types using the cast() function?
What is bcnf normalization form?
What is the use of floor function in sql server?
What does normalization do to data?
Can we delete data from a view?
What is the difference between index seek vs. Index scan?
Explain the use of keyword with encryption. Create a store procedure with encryption?