I have two tables:
Table 1 = products (id, name, organisationId, subcategoryId)
Table 2 = products_attribute_attributes (productId, attributeId)
I am trying to delete from Table 2 where attributes match a specific attributeId AND relate to products from a number of different organisationIds.
What I have tried is below:
DELETE product_attributes_attribute FROM product_attributes_attribute
INNER JOIN product
ON product.id = product_attributes_attribute.productId
WHERE attributeId = "154" AND organisationId IN (685,720,773,789,774,834,911,698);
MySQL gave me this response:
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
As I don't know MySQL very well I am fairly sure that safe update mode is essential for me to keep enabled to prevent potentially disastrous mistakes so I don't intend to disable it. What I don't understand is why it thinks I haven't used a WHERE clause when you can see that it is there in the code. What am I doing wrong?
products_attribute_attributes?