MDA/MDD/TDD/DDD/DDDDDDD
          posts - 536, comments - 111, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          oracle刪除重復(fù)數(shù)據(jù)

          Posted on 2008-02-01 23:21 leekiang 閱讀(398) 評(píng)論(0)  編輯  收藏 所屬分類: oracle
          查找重復(fù)數(shù)據(jù)
          select count(*), id from test? group by id having count(id) > 1
          詳見
          http://www.cnblogs.com/shw0315/articles/305959.html

          例子:登錄日志表里有128794條記錄,執(zhí)行以下sql
          ?delete from test a where a.rowid !=
          ?( select max(b.rowid) from test b where a.id = b.id? )
          共刪掉3471條,用時(shí)12617秒,有點(diǎn)慢??筛挠蒙厦骀溄永镏v的建臨時(shí)表的方式。
          主站蜘蛛池模板: 连山| 伊川县| 肇庆市| 信宜市| 嵊泗县| 华蓥市| 明水县| 贞丰县| 临潭县| 锦州市| 远安县| 沁阳市| 阳谷县| 谷城县| 淮阳县| 慈溪市| 德清县| 成都市| 剑阁县| 大邑县| 阜宁县| 建平县| 五家渠市| 曲麻莱县| 定边县| 临清市| 五峰| 靖宇县| 景泰县| 曲麻莱县| 栖霞市| 三河市| 连城县| 普安县| 阿坝| 海安县| 寿宁县| 石台县| 资源县| 丰都县| 元谋县|