I am trying to create a code where i would get all the rows from the existing table if the condition matches otherwise return "Record is not there". Below fetchall() excludes one row which is sitting in fetchone() function. As i am new to this, i am not sure what is going wrong.
cursor = conn.cursor()
result=cursor.execute("SELECT * from Documents where documentID like '1167%')
row= cursor.fetchone()
if row is None:
print('Record is not there')
else:
row=cursor.fetchall()
print(row)
I suggest you reassemble your rows in a list using the * :