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 閱讀(340) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2013年8月>
          28293031123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 墨玉县| 巩义市| 清水河县| 克什克腾旗| 宜阳县| 三河市| 白河县| 同德县| 方城县| 武功县| 江都市| 永福县| 汝南县| 会理县| 江口县| 堆龙德庆县| 芜湖市| 雷州市| 琼中| 浪卡子县| 陇西县| 南充市| 靖安县| 渑池县| 宁晋县| 保德县| 长白| 红原县| 涞水县| 西乡县| 池州市| 怀柔区| 德兴市| 思茅市| 西青区| 闻喜县| 贵南县| 沙田区| 金乡县| 明星| 法库县|