title: MySQL IF Condition in a Calculated Field
body: <p>I am trying to create a calculated field where if two values happen to be the same, the value doubles. I am coding this condition in the variable MY.  I am new to SQL, so I apologize.</p>
  
  <p>Here is my attempt:</p>
  
  <pre><code>SELECT EXPERT_SCORE*MY
  IF(CONSUMER_EXPERT_SCORE_ID= CONSUMER_EXPERT_ID, 1, -1) AS MY 
  FROM consumer_expert_score
  WHERE CONSUMER_EXPERT_SCORE_ID=2 OR 1;
  </code></pre>
  
  <p>Thanks in advance!</p>