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
Detail about query optimizer?
What is query cost in sql server?
What are the new data types are introduced in sql 2000?
Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.
What is a rollup clause?
What is the default port for SQL Server over a firewall?
Is mysql better than sql server?
Why de-normalization required?
What are the benefits of normalization?
What is key set driven?
on line cluster can we make if yes tell me the procedure
How to create new databases with "create database" statements?
what are the critical issues you have resloved in your company
What is report rendering ?
Explain what is dbcc?