Python Forum
SQlite3 quickly increment INT value? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: SQlite3 quickly increment INT value? (/thread-16547.html)



SQlite3 quickly increment INT value? - jmair - Mar-04-2019

Is there a slick +=1 for INT values in an SQLite3 table?

For example, a table named 'users'
name, gamesplayed
a suedo code example of what I'm looking for would be.
c.execute(FROM users WHERE name=? SET gamesplayed=? ,("Gary", gamesplayed+=1))



RE: SQlite3 quickly increment INT value? - stranac - Mar-04-2019

c.execute('UPDATE users SET gamesplayed = gamesplayed + 1 WHERE name = ?', ['Gary'])