最近新的项目需要销售数据,我将近3年的销售数据全部倒入 800w条,突然发现有2116条重复数据,Oracle 10G的数据库。一下是我的解决方案,不知道各位有没有更好的方案,要效率的
delete from table1 tt1 where tt1.column1 in(select max(t.rowid )from table1 t group by t.column1,t.column2,t.column3,t.column4having count(t.column1)>1 order by t.sys_storeno)还没有执行 但是我感觉这种方法肯定执行起来很慢。我有想用procedure去做。各位还有别的什么好的方法吗?
ps:最好不要使用临时表去做 800万 oracle 重复数据
delete from table1 tt1 where tt1.column1 in(select max(t.rowid )from table1 t group by t.column1,t.column2,t.column3,t.column4having count(t.column1)>1 order by t.sys_storeno)还没有执行 但是我感觉这种方法肯定执行起来很慢。我有想用procedure去做。各位还有别的什么好的方法吗?
ps:最好不要使用临时表去做 800万 oracle 重复数据
group by columns(重复列标识)
having count(*)>1;
group by columns(重复列标识)
having count(*)>1);
delete from tables t where t.columns(重复列标识) in(select t.columns(重复列标识) from t1);
PL/SQL在效率上肯定比SQL稍微低了点
在数据没有被你取出前,distinct剔重不行吗?基于你的3年销售数据的品质,1楼的方法其实可以考虑
在数据没有被你取出前,distinct剔重不行吗?
一言难尽。