I'm trying to create a trigger that will only run if the condition is met.
create trigger t_free
before insert on vacation_days
for each row
if new.days_newtier>= 365
then set new.free=new.days_CurrYear*(select a.rate
from algorithm a where new.work_days between a.day1 and a.day2);
I keep getting a syntax error. The trigger works fine without the if statement.