IF-оператор в SQLite: обновить или вставить?

Я не могу запустить этот запрос с SQLite

if 0<(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

Там написано "Синтаксическая ошибка рядом с IF" Как я могу решить проблему

Ответы на вопрос(4)

Ваш ответ на вопрос