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, 观测时间, 取样位置
   

猜你喜欢

转载自blog.csdn.net/lh376152/article/details/78840559