Python Forum
SQlite3 quickly increment INT value?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQlite3 quickly increment INT value?
#1
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))
Reply
#2
c.execute('UPDATE users SET gamesplayed = gamesplayed + 1 WHERE name = ?', ['Gary'])
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  help to increment a third list hermine 7 1,269 Nov-29-2022, 04:19 PM
Last Post: perfringo
  mysql id auto increment not working tantony 10 2,309 Oct-18-2022, 11:43 PM
Last Post: Pedroski55
  Character Increment AnokhiRaaz 1 2,461 Apr-22-2021, 04:29 AM
Last Post: buran
  Increment text files output and limit contains Kaminsky 1 3,135 Jan-30-2021, 06:58 PM
Last Post: bowlofred
  Increment formula Kristenl2784 4 2,818 Jul-20-2020, 10:14 PM
Last Post: Kristenl2784
  [openpyxl] Increment cells being pasted into Template Kristenl2784 4 3,507 Jul-16-2020, 10:00 PM
Last Post: Kristenl2784
  How can I increment a List item with in a "for in" msteffes 4 3,486 Aug-14-2019, 08:55 AM
Last Post: DeaD_EyE
  How define iteration interval increment SriMekala 5 4,250 Jun-01-2019, 01:06 PM
Last Post: ichabod801
  increment variable in while loop Naito 3 2,928 Jan-20-2019, 12:30 PM
Last Post: Naito
  auto increment ambush 7 14,262 Nov-02-2018, 10:52 PM
Last Post: LeSchakal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020