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
How can we call UDF(User Define Function) using C# code in ASP.net ?
How to read data in a table with "select" statements?
What is delete query?
If a table does not have a unique index, can a cursor be opened on it?
How to copy the tables, schema and views from one sql server to another?
What are character string data types in ms sql server?
You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?
What is a view in sql?
What is the maximum number of index per table?
New concepts of sql server 2005 use in your project.
What are the diifferences between the ms sql server vs mysql?
Explain the concept of view and Types of views in SQL server?
How to create “dependant” parameter “make, model, year”
What area unit the various kinds of info compression introduced in sql server 2008?
How to transfer a table from one schema to another?