/*根据“column1+column2”判断数据重复,把重复数据中要保留的记录的“column1+column2+id”放到临时表*/
create table t_table_name_temp
select 
	column1 as del_column1, 
	column2 as del_column2, 
	max(id) as excluded_id
from t_table_name
group by column1, column2
having count(*) > 1;

/*结合临时表去掉重复记录*/
delete from t_table_name
where exists (
	select 1 from t_table_name_temp 
	where del_column1 = column1 
	and del_column2 = column2
	and excluded_id <> id);