my sql 데이터베이스 의 중복 데이터 기록 삭제

다음 방법 으로 삭제 할 수 있 습 니 다.테스트 데이터베이스 의 title 필드 를 중복 한다 고 가정 합 니 다. 

create table bak as (select * from test group by title having count(*)=1);     
insert into bak (select * from test group by title having count(*)>1);        
truncate table test;        
insert into test select * from bak;

좋은 웹페이지 즐겨찾기