how to delete duplicate rows from table in sql server
Answer Posted / smitha
;with empctc(empid,ename,sal,deptid,ranking)
as
(Select empid,ename,sal,deptid,ranking=Dense_rank() over (
partition by empid,ename,sal,deptid order by NEWID() asc)
from emp
)
delete * from empctc where ranking>1
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the beast way to write CTE in SQL Server ?
What do you understand by the analysis services in sql server?
How do I setup a sql server database?
What do you understand by the data quality services in sql server?
What is a trace frag? Where do we use it?
What stored procedure can you use to display the current processes?
What is inner join in sql server joins?
What is usually the first word in a sql query?
What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?
List layers of abstraction microsoft architectured to provide relational db through cloud platform ?
What are the advantages of stored procedure in sql server?
What do you mean by authentication modes in sql server?
Can you explain full-text query in sql server?
What is tablesample?
Does partitioning improve performance sql server?