0

我正在尝试恢复从 SQL 文件中丢失的一些数据。我想知道是否可以在所有数据或某些部分周围插入一个 IF NOT EXIST ?例如,我有超过 500 行:

INSERT INTO `TOWNY_RESIDENTS` (`name`, `town`, `lastOnline`, `registered`, `isNPC`, `title`, `surname`, `protectionStatus`, `friends`, `townBlocks`, `town-ranks`, `nation-ranks`) 
VALUES
('003497', '', 1345023973086, 1344596322606, 0, '', '', 'residentBuild,residentDestroy,residentSwitch,residentItemUse', '', '', NULL, NULL),
('007belg', '', 1359561715886, 1359561236484, 0, '', '', 'residentBuild,residentDestroy,residentSwitch,residentItemUse', '', '', '', ''),
('00Landmine', '', 1360592736927, 1360592672899, 0, '', '', 'residentBuild,residentDestroy,residentSwitch,residentItemUse', '', '', '', '')
4

1 回答 1

0

您是否尝试过忽略?

INSERT IGNORE INTO `TOWNY_RESIDENTS`
(`name`, `town`, `lastOnline`, `registered`, `isNPC`, `title`, `surname`, `protectionStatus`, `friends`, `townBlocks`, `town-ranks`, `nation-ranks`)
VALUES ('003497', '', 1345023973086, 1344596322606, 0, '', '', 'residentBuild,residentDestroy,residentSwitch,residentItemUse', '', '', NULL, NULL)
于 2013-03-08T15:08:25.213 回答