title: If conditional in SQL Script for Mysql
body: <p>In a sql script that does sequential execution, is there a way one can introduce an IF THEN ELSE conditional to control the flow of query execution?</p>
  
  <p>I happened to run into this <a href="http://www.bennadel.com/blog/1340-MySQL-Does-Not-Support-IF-ELSE-Statements-In-General-SQL-Work-Flow.htm">http://www.bennadel.com/blog/1340-MySQL-Does-Not-Support-IF-ELSE-Statements-In-General-SQL-Work-Flow.htm</a> 
  which says that the IF THEN ELSE will not work in a sql script.</p>
  
  <p>Is there another way around?</p>
  
  <p>Basically, I want to run a particular "select colName from table" command and check if colName corresponds to a particular value. If it does, proceed with the rest of the script. Else, halt execution.</p>
  
  <p>Please advise.</p>