Sqlite – How to update two columns in one statement

sqlite

How can I update 2 columns at a time?

I tried the following statement, which doesn't work:

UPDATE exercises
SET times_answered = times_answered + 1
AND av_answeringTime = av_answeringTime + ( (av_answeringTime / (times_answered) ) + ?) * (times_answered + 1)
WHERE name = ?

Best Solution

Use a comma instead of your "AND":

UPDATE exercises
SET times_answered = times_answered + 1,
    av_answeringTime = av_answeringTime + ( (av_answeringTime / (times_answered) ) + ?) * (times_answered + 1)
WHERE name = ?