当前位置: 代码迷 >> Informix >> 请教好何删除一个表里的重复记录
  详细解决方案

请教好何删除一个表里的重复记录

热度:9523   发布时间:2013-02-26 00:00:00.0
请问好何删除一个表里的重复记录
如表

num     score
1           23
1           23
2           60    
3           70
2           60


想删成

num     score
1           23
2           60    
3           70


这样,怎么做啊?

------解决方案--------------------------------------------------------
完全一样?要借助临时表了.
------解决方案--------------------------------------------------------
unload to 'test_kk.unl '
select * from test_kk
group by 1,2
;
delete from test_kk
;
load from 'test_kk.unl '
insert into test_kk

------解决方案--------------------------------------------------------
笨方法:select distinct num from tabname into temp a1
delete from tabname
insert into tabname select * from a1
还有简单的方法,难得去想。。