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 ="""SELECT MAX(Trackid) FROM table LIMIT (?) OFFSET (?)"""
self.cur.execute(sql, (span, index,))
return self.cur.fetchone()
I next tried using a combination of python and sqlite commands and could get the answer.
def get_rows_max_id(self, index, span=100,):
sql ="""SELECT Trackid FROM table LIMIT (?) OFFSET (?)"""
self.cur.execute(sql, (span, index,))
return max(self.cur.fetchall())
However, I believe a pure sqlite3 command would be able to do the job. Can you tell me what is the correct Sqlite commands to use? Pls note that column Trackid can be randomly ordered and may not follow the ascending order that is shown in the picture.