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)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 民丰县| 嘉定区| 中西区| 荥阳市| 武定县| 江津市| 叙永县| 平乡县| 沈丘县| 阳泉市| 鄂托克前旗| 渝北区| 会宁县| 东阳市| 息烽县| 绵竹市| 亚东县| 棋牌| 神木县| 青神县| 华安县| 侯马市| 河北省| 云南省| 威海市| 北票市| 英吉沙县| 布拖县| 依安县| 卓尼县| 金堂县| 张北县| 崇阳县| 顺平县| 龙游县| 金川县| 巍山| 沙河市| 磐石市| 米林县| 屏边|