大家都可能遇到字段重复的情况,网上很多人在找方法,也给出了一些方法,但是有的方法是误导大家,铁牛写出以下方法,方便大家使用
1. Filter out duplicate fields through group by and create a temporary table tmp
create table tmp as select max(id) as col1 from www group by dfdfd;
2. Use the not in condition to filter out the column col1 that is not in the temporary table from the deduplication table object, and perform the not in deletion operation
delete from www where id not in (select col1 from tmp);
3. Delete temporary table
drop table tmp;
Welcome to join the PHP technology and workplace exchange group: 383730534