0

I want to merge two tables, but not the duplicate entries with similar id field.

But I get error after:

INSERT INTO table1 (id, name) 
      SELECT id, name FROM table2 WHERE table2.id NOT_IN (SELECT id FROM table1);
4

1 回答 1

1

你必须改变NOT_INNOT IN因为这是正确的合成器

INSERT INTO table1 (id, name) 
SELECT id, name FROM table2 WHERE table2.id NOT IN(SELECT id FROM table1);
于 2013-08-14T08:56:58.377 回答