title: MySQL: Update Query using If else
body: <p>I want to update the table and I am not known which column is going to update.
  Here is the simple example</p>
  
  <pre><code>Update tablename
  set 
  if col1='A' then col1='IA',col2='XXX'
  if col3='A' then col3='IA', col4='XXX'
  where
  (col1='A' and col2='UNKNOWN') or (col3='A' and col4='UNKNOWN')
  </code></pre>
  
  <p>Here either <code>col1</code> or <code>col3</code> surely contains <code>'A'</code></p>
  
  <p>Please provide me correct query</p>