seth
Nov 17th, 2007
Nov 17th, 2007
Having SQL: An Easy Way to Find Duplicate Rows with SQL
This will not get you to SQL-foo master status, but it will help you out when trying to find duplicate rows in a database table that is, err, let's just say not-so-well-formed:
select count(*), min(id), max(id), email from users group by email having count(*) > 1;