When using the query below I'm inserting product_id and I also want to set field category_id = 4 for all inserted product_ids. Here's my code to insert products.
INSERT INTO lc_products_to_categories
( product_id)
SELECT product_id
FROM lc_products_info
where name like '%awesome product%'
How to update category_id with single query?
INSERT INTO lc_products_to_categories
( product_id, category_id)
SELECT product_id, 4
FROM lc_products_info
where name like '%awesome product%'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments