Mysql Having

    mysql/postgresql 중복되는 데이터 항목 찾기

    mysql/postgresql 중복되는 데이터 항목 찾기

    중복 데이터 찾기 mysql 에서 특정 컬럼에서 중복되는 항목이 있는지 찾고자 한다. 컬럼 하나일 때 select 컬럼이름 , count(컬럼이름) from 테이블이름 s group by 컬럼이름 having count(컬럼이름) > 1 컬럼 여러개일 때 select 컬럼이름1, 컬럼이름2, 컬럼이름3, count(컬럼이름1) from 테이블이름 s group by 컬럼이름1, 컬럼이름2, 컬럼이름3 having count(컬럼이름1) > 1 select title,date,site , count(title) from tablename s group by title ,date,site having count(title) > 1