重複したレコードがないかをチェックする【SQL】

SQL文でテーブル中にあるフィールドを対象にして重複がないかを確認する。

select field1,count(*) from tablename group by field1 having count(*) > 1;

でチェックできる。