UPDATE
oc_decomo_items di1
SET
di1.product_id=NULL,
di1.add_to_shop=0
FROM
oc_decomo_items di
LEFT JOIN oc_product p
ON p.product_id=di.product_id
WHERE
di.product_id IS NOT NULL
AND p.product_id IS NULL
AND di1.item_id = di.item_id
Выдает ошибку. Не могу понять почему.
SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM
oc_decomo_items di
LEFT JOIN oc_product p
ON p.product_id=di.product_' at line 6
Сама выборка без update работает:
SELECT di.product_id FROM oc_decomo_items di
LEFT JOIN oc_product p
ON p.product_id=di.product_id
WHERE
di.product_id IS NOT NULL
AND p.product_id IS NULL