-
-
Save cubespace/5274b12f27b628fa3cc13482248f7d9e to your computer and use it in GitHub Desktop.
Копировать выборочно данные из одной таблицы в другую
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
--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