Advertisement
kotvalera83

Mass product category update

Dec 29th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.20 KB | None | 0 0
  1. INSERT IGNORE INTO ps_category_product SELECT 2, id_product, ((SELECT MAX(POSITION) FROM ps_category_product WHERE id_category = 2) + (@inc := @inc + 1)) FROM ps_product INNER JOIN (SELECT @inc := 0) AS i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement