Copy data from one table to another table, and insert it.
INSERT INTO destination_table(
col1, col2, col3, col4, col5, col6
)
SELECT col1, col2, col3, 'custom_value' as col4, col5, col6
FROM source_table;
Copy data from one table to another table, and insert it.
INSERT INTO destination_table(
col1, col2, col3, col4, col5, col6
)
SELECT col1, col2, col3, 'custom_value' as col4, col5, col6
FROM source_table;
Copy data from one table and update with having same id and conditions
UPDATE destination_table
SET
col1 = source_table.col1,
col2 = source_table.col2
FROM source_table
WHERE destination_table.col1 = source_table.col1
AND source_table.col2 = 'this is cool'