title: IF in MySQL script
body: <p>I have the following script:</p>
  
  <pre><code>
  use my_db;
  
  if (2 &lt; 3) then
      select 1;
  end if;
  </code></pre>
  
  <p>When I execute this with command:</p>
  
  <blockquote>
    <p>mysql --user=myuser --password=mypassword &lt; script.sql</p>
  </blockquote>
  
  <p>I get the following error:</p>
  
  <p><code>ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if (2 &lt; 3) then
      select 1' at line 1</code></p>
  
  <p>Can anybody explain me why this?
  From mysql docs found <a href="https://dev.mysql.com/doc/refman/5.7/en/if.html" rel="noreferrer">here</a> I think it should be working fine.</p>