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

What command do we use to rename a db, a table and a column?

919


what is database replication? : Sql server database administration

1048


What is the difference between functions and stored procedures?

1150


What are user-defined functions (udfs) in sql server?

979


What are the different acid properties?

1053


What are the recovery models for a database?

1100


What is the importance of a recovery model?

1040


What are the new features of sql server 2008 r2 reporting service?

208


What is a system database and what is a user database?

1071


How to change a login name in ms sql server?

1067


Is mysql better than sql server?

1052


How to Update from select query in sql server?

1049


Explain Reporting Life Cycle?

127


What is 4nf in normalization form?

1013


What is Replication?

1032