sql去重


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;

posted on 2013-08-27 15:39 Mr.lu 阅读(323) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2013年8月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

导航

统计

常用链接

留言簿(2)

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜