ORA-00001: 违反唯一约束条件
首先排除一下,要插入的数据(主键)是否和要插入的表里有重复数据,如果有先过滤一下
delete from 数据源表 where 主键字段 in (select 主键字段 from 要插入的表)
然后看下要插入的新数据(主键)本身是否有重复数据,如果有需要去重
DELETE from 需要去重表
WHERE (主键) IN (SELECT 主键
FROM 表
GROUP BY 主键
HAVING COUNT(主键) > 1)
AND ROWID NOT IN (SELECT MIN(ROWID)
FROM 表
GROUP BY 主键
HAVING COUNT(*) > 1);