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


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


          網(wǎng)站導(dǎo)航:
           
          <2013年8月>
          28293031123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 巩义市| 昌宁县| 清流县| 上饶市| 京山县| 嵩明县| 临汾市| 寻乌县| 思南县| 邛崃市| 炉霍县| 余庆县| 淮安市| 喀喇沁旗| 泸水县| 鄢陵县| 汾阳市| 赤壁市| 白河县| 宜春市| 凤城市| 北海市| 米林县| 宁安市| 蒲江县| 棋牌| 南平市| 景洪市| 墨竹工卡县| 合水县| 阿瓦提县| 集贤县| 泗洪县| 丘北县| 五华县| 平阴县| 吴江市| 报价| 弥渡县| 滨州市| 克东县|