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
Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?
what is the different types of backups available in sql server? : Sql server database administration
How can we delete Duplicate row in table?
What is the report model project?
Why do we use functions?
How you can get a list of all the table constraints in a database?
What is log in sql server?
What options are there to delete rows on the publisher and not on the subscriber? : sql server replication
Can we use where and having clause together?
what are different types of raid configurations? : Sql server database administration
How do you manipulate data?
What is the use of @@spid?
What is a bit datatype?
How to delete an existing row with delete statements in ms sql server?
can any body tell me how to know the password of current user in sql server