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 records from a table?(for suppose in
a table we have 1000 Records in that we have 200 duplicate
Records , so ,how to findout that duplicate Records , how to
delete those Records and arranged into sequence order? one
more thing that there is no primary key at all)

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 ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration

1022


What is a synonym for manipulation?

1050


What the different types of Replication and why are they used?

1133


What do you understand by coalesce in sql server?

1129


What is normalization? Explain different forms of normalization?

1233


How can a user-defined datatype be created?

1039


Does partitioning help performance?

997


What is data source in connection string?

958


How can I track the changes or identify the latest insert-update-delete from a table?

1015


What are diverse clauses that form a part of sql?

1113


What are the different types of sql server replication? : sql server replication

1369


What are the mathematical functions supported by sql server 2005?

1128


Delete duplicate rows without using rowid.

1588


How to perform key word search in tables?

1005


Explain what are the restrictions while creating batches in sql server?

1116