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 are the different types of sql server replication? : sql server replication
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
Can you get second highest salary from the table?
How do we synchronize On-Premise SQL server with SQL Azure?
Describe triggers features and limitations?
What stored by the tempdb ? : sql server database administration
How is a full-text index updated?
What is filter index?
between cast and convert which function would you prefer and why?
Is sql server free?
What is use of attribute hierarchy optimized state? : sql server analysis services, ssas
How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?
What happens if ntwdblib.dll is missing on your machine?
If a table does not have a unique index, can a cursor be opened on it?
What is the maximum row of a size?