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


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


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

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 静乐县| 乾安县| 淮南市| 万源市| 客服| 法库县| 卢氏县| 瑞昌市| 大冶市| 通许县| 突泉县| 都安| 东方市| 樟树市| 平凉市| 那坡县| 石家庄市| 遂宁市| 舒兰市| 茶陵县| 清河县| 建宁县| 哈密市| 常州市| 凯里市| 安新县| 西乌珠穆沁旗| 沧源| 寿阳县| 武邑县| 综艺| 奈曼旗| 宁海县| 邢台县| 娱乐| 定安县| 高邮市| 岳普湖县| 和硕县| 得荣县| 东港市|