MySQL – insert data from another table merged with constants

Use an INSERT ... SELECT statement where you are selecting constant values as well as data from products_temp:

INSERT INTO products (product_data, vendor_id)
    SELECT data, '1' FROM products_temp

Leave a Comment