创建临时表:储存要保持的数据
create table fanwe_comment_temp (
`id` int(11) not null,
primary key (`id`)
)engine=myisam default character set=utf8;
`id` int(11) not null,
primary key (`id`)
)engine=myisam default character set=utf8;
查询插入:保持唯一数据
insert into fanwe_comment_temp(id) SELECT id FROM fanwe_goods_comment group by goods_id,commont_id;
删除重复的 唯一编号
delete from fanwe_goods_comment where id not in (select id from fanwe_comment_temp);
delete from fanwe_goods_comment where id not in (select id from fanwe_comment_temp);
fanwe_goods_comment_bf 这个是备份表