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
More Related Contents:
- MySQL INSERT INTO … VALUES and SELECT
- MySQL error 1241: Operand should contain 1 column(s)
- Insert data into table with result from another select query
- Recreating a query using INNER JOIN? [duplicate]
- MySQL – UPDATE query based on SELECT Query
- Create a temporary table in a SELECT statement without a separate CREATE TABLE
- MySQL SELECT WHERE datetime matches day (and not necessarily time)
- MySQL Query – Records between Today and Last 30 Days
- Ordering by specific field value first
- SQL – IF EXISTS UPDATE ELSE INSERT INTO
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- INSERT INTO…SELECT for all MySQL columns
- #1139 – Got error ‘repetition-operator operand invalid’ from regexp
- Checking multiple columns for one value
- BULK INSERT in MYSQL
- MySQL difference between two rows of a SELECT Statement
- How to insert data to MySQL with auto-incremented column(field)?
- MySQL – How to search for exact word match using LIKE?
- MySQL – How to select data by string length
- MySQL Insert & Joins
- How to add a where clause in a MySQL Insert statement?
- SELECT query return 1 row from each group
- Comma separated string of selected values in MySQL
- SQL query to check if a name begins and ends with a vowel
- SELECT INTO Variable in MySQL DECLARE causes syntax error?
- MySQL Error: #1142 – SELECT command denied to user
- MySQL optimizing INSERT speed being slowed down because of indices
- MySQL – How to parse a string value to DATETIME format inside an INSERT statement?
- Incorrect integer value: ” for column ‘id’ at row 1
- MySQL cartesian product between two SELECT statements