当代第一IT诗人 ——代腾飞

导航

如何查找和删除重复记录

如何查找重复记录?

SELECT * FROM TABLE_NAME
WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D
WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2);

如何删除重复记录?

DELETE FROM TABLE_NAME
WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D
WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2);

posted on 2006-03-25 11:55  IT诗人  阅读(377)  评论(0编辑  收藏  举报

我要啦免费统计