title: Using an if statement outside a stored procedure
body: <p>I am trying to execute this code</p>
  
  <pre><code>set @id = 0;
  set @the_number = 0;
  set @the_message = 0;
  set @selected_message = 0;
  
  SELECT id, dest_msisdn, text_message INTO @id, @the_number, @the_message FROM incoming_sms where service_id = 6015592000101762 AND job_status = 0 limit 1;
  
  if(@the_message LIKE '%Bank%')then
  
  select 'h';
  
  end if;
  </code></pre>
  
  <p>but i keep getting an error on</p>
  
  <pre><code>if(@the_message LIKE '%Bank%')then
  
  select 'h'' at line 1 
  </code></pre>
  
  <p>Why is my if producing an error?.</p>