Skip to content

Instantly share code, notes, and snippets.

@songyunlu
Last active December 14, 2015 10:08
Show Gist options
  • Save songyunlu/5070114 to your computer and use it in GitHub Desktop.
Save songyunlu/5070114 to your computer and use it in GitHub Desktop.
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);
/* 可能引起同步的延遲,還可能導致同步出錯,特別是有設定 AUTO_INCREMENT 時 */
INSERT INTO table1 (SELECT * FROM table2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment