title: Simple IF.. Else.. mysql Query
body: <pre><code>set @var=1;
  if @var&gt;1 then 
  select * from client;
  else
  select * from otherTable;
  end if;
  </code></pre>
  
  <p>This is my mysql query. Can you guys point out why is it showing error?
  This is really eating my brains out.</p>
  
  <p>The Error displayed is</p>
  
  <pre><code>IF @var &gt;1 THEN SELECT *
  FROM client;
  
  MySQL said: Documentation
  #1064 - 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 @var&gt;1 then
  select * from client' at line 1 
  </code></pre>
  
  <p>Fast answer would be really helpful.</p>