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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I find the duplicate rows in mysql and also make it unique.

Status
Not open for further replies.

toomee

Technical User
Jan 28, 2003
10
0
0
TH
How can I find the duplicate rows in mysql and also make it unique.

Thanks a lot

 
Code:
select c1,c2 
  from t
 group by c1,c2
 having count(*) > 1

SQL has two mechanisms for avoiding duplicity, primary keys and unique constraints. Do a search in the docs at for more information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top