Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding duplicate records

Status
Not open for further replies.

divinyl

IS-IT--Management
Nov 2, 2001
163
GB
Hi all,

I would like to create a composite key on a table in a database that already has loads of records. It is not letting me because there are duplicate records in the database, and i need to be able to identify these duplicates and delete them. What kind of query can i write that will group all duplicate records for meso i can then delete them?

Any assistance much appreciated.

Divinyl
 
select id,sum(salaries)
from tbl
having count(id)>=2
group by id

 
thanks to both of you who replied- both of these worked well.

Divinyl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top