忙中偷闲,整理了30772个汉语成语,但是在整理的过程中药删除大概1025条重复的数据,这些数据应该是在采集整理的过程中网络中断造成的重复。
下面的就是一条简单的语句用来删除一个表中重复的记录:
DELETE FROM ChengYu WHERE (ID NOT IN (SELECT ID = MIN(ID) FROM ChengYu GROUP BY name))
DELETE FROM Table WHERE (KeyID NOT IN (SELECT KeyID = MIN(KeyID) FROM Table GROUP BY Name))