title: SQLite: possible to update row or insert if it doesn't exist?
body: <p>I'm sure I can check if a row exists by selecting it but I'm wondering if there's a slicker way that I'm just not aware of -- seems like a common enough task that there might be. This SQLite table looks something like this:</p>
  
  <pre><code>rowID  QID    ANID  value
  ------ ------ ----- ------
  0      axo    1     45
  1      axo    2     12
  </code></pre>
  
  <p>If the combination of QID and ANID already exists, that value should be updated, if the combination of QID and ANID doesn't already exist then it should be inserted. While its simple enough to write:</p>
  
  <pre><code>SELECT * where QID = 'axo' and ANID = 3;
  </code></pre>
  
  <p>And check if the row exists then branch and either insert/update I can't help but look for a better way. Thanks in advance!</p>