title: IF ELSE Condition in SQLite
body: <p>I am new to SQLite.</p>
  
  <p>I am looking for <code>IF ELSE</code> in SQLite to perform <code>UPDATE</code> OR <code>INSERT</code> operation based on the condition check.</p>
  
  <p>What I tried is:</p>
  
  <pre><code>IF EXISTS(SELECT 1 FROM TblTest WHERE ID = 1 AND Name = 'XYZ')
  BEGIN
  END
      UPDATE TblTest
      SET Address = 'NYC',
      Mobile='102938340'
      WHERE ID = 1 AND Name='XYZ'
  ELSE
  BEGIN
  INSERT INTO TblTest(ID,Name,Address,Mobile)
      VALUES(1,'XYZ','NYC','102938340');
  END
  </code></pre>
  
  <p>Getting an error:</p>
  
  <blockquote>
    <p>Result: near "IF": syntax error</p>
  </blockquote>