title: Using 'LIKE' inside IF statement
body: <p>I need to sort a table using a condition. I used the below statement,</p>
  
  <pre><code>select * from table1 order by if (col1 like '%Cochin%', substr(col1,1,4), col1)
  </code></pre>
  
  <p>But I got an error, "missing right parenthesis".</p>