Created
July 3, 2017 15:58
-
-
Save jkpr/204f5f5318080ae5962d8272cce1eea4 to your computer and use it in GitHub Desktop.
SQLite merge table of one database into table of another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sqlite3 db1.sqlite | |
> ATTACH '/path/to/db2.sqlite' AS mergeme; | |
> BEGIN; | |
> INSERT INTO photos SELECT * FROM mergeme.photos WHERE mergeme.photos.orig_md5 NOT IN (SELECT orig_md5 FROM photos); | |
> COMMIT; | |
> DETACH mergeme; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you!