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 retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / anoop rajan

Tbale emp had some duplicate entries and i wanted to retain
the first of all duplicates, the others could be deleted as
follows . Please give your comments if this is the most
optimum way :

delete from emp where rowid in
(select rowid from emp o where rowid !=
(select min(rowid) from emp i where i.empno=o.empno));

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?

2513


What is the fastest way to permanently delete a 1 million row table named customers?

1255


What is enhanced database mirroring in sql server 2008?

978


System requirements for sql server 2005 express edition?

1037


What is Federation and Federation Member?

92


hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.

2076


Explain transaction server auto commit?

1047


What are the components of sql server service broker?

1026


What is the difference between a unique key and primary key?

963


Why are you getting errors when creating a new odbc dsn?

1231


How do database indexes work?

1019


User wants only to display only pdf as export option in report manager. How to achieve this?

265


What is the difference between inner join and equi join?

1005


Explain different types of lock modes in sql server 2000?

939


Why should you use or avoid select * statements?

1033