Вставить данные из другой таблицы
#PostgreSQL
INSERT INTO table1 (column11, column12, ...)
SELECT column21, column22, ...
FROM table2
[WHERE condition];
Mimisaurio
#PostgreSQL
INSERT INTO table1 (column11, column12, ...)
SELECT column21, column22, ...
FROM table2
[WHERE condition];
INSERT INTO sales.addresses (street, city, state, zip_code)
SELECT
street,
city,
state,
zip_code
FROM
sales.customers
ORDER BY
first_name,
last_name;