create table temp_dp_id_ent_info as select min(id) as id from dianping_deal_business group by deal_id,business_id having count(1)>1;
create table temp_dp_deal_id_ent_info as select deal_id from dianping_deal_business group by deal_id,business_id having count(1)>1;
delete from dianping_deal_business
where deal_id in (select deal_id from temp_dp_id_ent_info)
and id not in (select id from temp_dp_id_ent_info);
drop table temp_dp_id_ent_info;
drop table temp_dp_deal_id_ent_info;