Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can we call UDF(User Define Function) using C# code in ASP.net ?

6871


How to read data in a table with "select" statements?

959


What is delete query?

932


If a table does not have a unique index, can a cursor be opened on it?

906


How to copy the tables, schema and views from one sql server to another?

1036


What are character string data types in ms sql server?

1231


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?

155


What is a view in sql?

966


What is the maximum number of index per table?

1067


New concepts of sql server 2005 use in your project.

2354


What are the diifferences between the ms sql server vs mysql?

1164


Explain the concept of view and Types of views in SQL server?

983


How to create “dependant” parameter “make, model, year”

131


What area unit the various kinds of info compression introduced in sql server 2008?

1071


How to transfer a table from one schema to another?

993