更新时间:2022-04-30 08:02:45
如 INSERT
语法:
没有
IGNORE
的情况下,与表中现有的UNIQUE
索引或PRIMARY KEY
值重复的行会导致重复键错误,并且该语句将中止.使用IGNORE
,仍不会插入该行,但不会发出错误.
without
IGNORE
, a row that duplicates an existingUNIQUE
index orPRIMARY KEY
value in the table causes a duplicate-key error and the statement is aborted. WithIGNORE
, the row still is not inserted, but no error is issued.
您需要在md5sum
上定义UNIQUE
索引:
ALTER TABLE rss_feeds ADD UNIQUE INDEX (md5sum);