sql

928阅读 0评论2011-10-28 daydaycome
分类:DB2/Informix

informix数据去重
假设test表以fd1,fd2字段为唯一元素
select  b.rowid id from test a , test b where a.fd1=b.fd1 and a.fd2=b.fd2 and a.rowid<>b.rowid and a.rowid in (select min(rowid) from test group by fd1,fd2) into temp rmrow; 
delete from test where rowid in (select id from rmrow);
上一篇:没有了
下一篇:proc 中的外连接