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