title: IF-Statement in SQLite: update or insert?
body: <p>I Can't run this query with SQLite</p>
  
  <pre><code>if 0&lt;(select COUNT(*) from Repetition where (Word='behnam' and Topic='mine'))
  begin
   update Repetition set Counts=1+ (select Counts from Repetition where (Word='behnam' and Topic='mine'))
  end
  else
  begin
      insert Repetition(Word,Topic,Counts)values('behnam','mine',1)
  end
  </code></pre>
  
  <p>It says "Syntax error near IF" 
  How can I solve the problem</p>