I faced some weird mysql subquery issues ...
UPDATE site_plugin_products_items
SET item_distributor = 176
WHERE item_id in (
SELECT item_id
FROM `site_plugin_products_field_values`
WHERE value_val in ( 554, 1384 , 785 )
)
I the problem is:
Result that query updated ENTIRE table site_plugin_products_items with item_distributor = 176
If i ran the subquery individual:
SELECT item_id
FROM `site_plugin_products_field_values`
WHERE value_val in ( 554, 1384 , 785 )
I get the following error because i put the wrong field, it was supposed to be value_product, not item_id
Error in query (1054): Unknown column 'item_id' in 'field list'
Why did this happen ? Shouldn't the big query return an error instead of messing the entire table ?
Lost 2 years when I saw the result, and didn't know if I have a close backup :)