Last active
May 30, 2017 08:57
-
-
Save igorpronin/08c4965696e284257d8f527f7a8ccd0d to your computer and use it in GitHub Desktop.
Копировать выборочно данные из одной таблицы в другую
This file contains hidden or 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
--example 1 | |
INSERT INTO cheap_books (id, note) | |
SELECT id, 'Was in use' | |
FROM Books WHERE id > (SELECT MAX(id) FROM Books) - 3 | |
--example2 | |
INSERT INTO public.table1 (id_user, id_operator, status) | |
SELECT field1, 'field2', '300' | |
FROM tmp.table2 WHERE id = 33951632290 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment