Skip to content
Advertisement

sqlite3.OperationalError:: syntax error when trying to UPDATE

I have been trying to update some values in a sqlite3 table but I am having loads of problems with the `sqlite3.OperationalError: near “GROUP”: syntax error. I have been following the documentation but I am not been very successful to correct the error. What I am trying to do is to find the all_numbers with a value =0 and updated with the max(value)+1 I just need to say that I am new creating databases so any help would be highly appreciated. Thanks in advance.

JavaScript

Advertisement

Answer

I think this is what you’re trying to do:

JavaScript

See the documentation of UPDATE FROM

I’m not sure why you’re doing this in a for loop, since you’re not using any of the variables in the loop. This updates the entire table at once, so it doesn’t need to be in a loop.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement