title: INSERT ... ON DUPLICATE KEY UPDATE (Two keys to compare)
body: <p>What I want to do is to just increment the 4th column of the value that it should've been if it didn't existed, when a row that has <code>col0 = valuecol0 AND col2 = valuecol2</code> is in the table.
  Otherwise, I want to insert the row, of course.</p>
  
  <pre><code>INSERT INTO tablename (col0, col1, col2, col3) 
  VALUES (valuecol0, valuecol1, valuecol2, valuecol3) 
  ON DUPLICATE KEY UPDATE col3 = col3 + VALUES( col3 );
  </code></pre>
  
  <p>Anyway, I can't figure out how I should set the INDEXes in the table, I read the page in the documentation <a href="http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html" rel="nofollow">here</a> but it wans't much of help. So I tried all the four possible combination and no one worked!</p>
  
  <p>Where am I failing?</p>