PDA

View Full Version : سوال: مشکل در دستور IF



behnam-s
شنبه 30 مهر 1390, 13:17 عصر
سلام، دوستان مشکل زیر چیه؟ فقط با SQL Server اجرا میشه. من میخوام با 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

میگه : Synatx error near IF


فرض کنید تو جدول زیر:
http://www.pic.iran-forum.ir/images/2lekbtozjla3hph2mbxr.jpg