Don't know how to formulate correctly in MySql, not good.
This:
Table
test_table in her columns
id_product,
quantity and
quantity_stock - everywhere Integer
Need:
So when you update the column
quantitycolumn
quantity_stock took a value =
new value of quantity - 10Here at all that I had, and apparently, I don't understand:
CREATE TRIGGER update_test AFTER UPDATE ON test_table FOR EACH ROW BEGIN IF NEW.quantity <=> OLD.quantity THEN UPDATE test_table SET quantity_stock = NEW.quantity - 10; END IF; END;