Zi-yan Tseng Zi-yan Tseng - 1 year ago 144
SQL Question

MySQL trigger update syntax error

I wander to set a trigger after update , and if the number of

less then 200 , it will be 200. And it's my code , how can i improve it?

The error message said that the error at line 4.

IF (SELECT product.Quanity<200)
UPDATE product
SET product.Quanity = 200

Using phpmyadmin - sql

Answer Source

Yo need use where for solve.

UPDATE product
SET product.Quanity = 200
WHERE product.Quanity < 200


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download