oracle数据库表中某几个字段的重复数据去重

delete from szpj_biz_水文观测数据 a
 where (a.观测点_id, a.观测时间, a.取样位置) in
       (select 观测点_id, 观测时间, 取样位置
          from szpj_biz_水文观测数据
         group by 观测点_id, 观测时间, 取样位置
        having count(*) > 1)
   and rowid not in (select min(rowid)
                       from szpj_biz_水文观测数据
                      group by 观测点_id, 观测时间, 取样位置
                     having count(*) > 1)

你可能感兴趣的:(oracle)