Questions tagged [sqlite3-python]

83 questions
-2
votes
1 answer

Sqlite3 commands to extract max value of a column for a specified range of rows?

source: link May I know what is the correct sqlite3 command to find the max value of column TracKid for let say from rows 4 to 8? I first tried the following method but was returned None: def get_rows_max_id(self, index, span=100,): sql…
Sun Bear
  • 7,594
  • 11
  • 56
  • 102
-2
votes
1 answer

How to select unique date from datetime column in sqlite3 python

This is how DB looks like I want to get only dates without any time like: [('2023-07-28',), ('2023-07-29',), ...] I've already tried: CURSOR.execute(f"SELECT strftime('%Y-%m-%d', date) FROM {name}_schedule WHERE strftime('%Y-%m-%d', date) >=…
PR. OR
  • 1
  • 2
-2
votes
1 answer

I can't get an integer from my Python sqlite3 database

I want to get the integer 5 from my database but I keep getting "[('5',)]" or "('5',)" this is my code: import sqlite3 db = sqlite3.connect("Users.db") cursor = db.cursor() def get_clearance(username='CC-2225', clearance=None): …
Noa
  • 3
  • 1
  • 2
-4
votes
1 answer

How to retrieve a value from a SQLite3 table by column name and matching row value

I have a table that looks like this (summarized, the first row is the column names): 'hand_total', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'A' ('5', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H') ('6', 'H', 'H', 'H', 'H', 'H', 'H', 'H',…
LaBeaux
  • 80
  • 1
  • 7
1 2 3 4 5
6