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

Can we call future method from trigger?

877


What are the characteristics of modern DBMS?

1029


How do we Backup SQL Azure Data?

106


Some queries related to SQL

933


What is the data tier application?

169


Explain transaction server isolation?

979


Do you know what are pages and extents? : SQL Server Architecture

941


What is the purpose of floor function?

974


Which table keeps information about stored procedures?

889


Can you explain what are commit and rollback in sql?

884


What is the size of transaction log file?

868


What is the rdl file?

123


What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.

1200


Can we delete data from a view?

880


How to create stored procedures with parameters in ms sql server?

990