I am wondering how to fetch more than 1 column at the same time. This is the code I have so far but iI get the error:
ValueError: too many values to unpack (expected 2)
con = sqlite3.connect('database.db')
cur = con.cursor()
cur.execute("SELECT name, age FROM employees")
name, age = cur.fetchall()
Is it actually possible to fetch more than 1 column at the same time? Thanks!
fetachallreturns a list of each row as tuples, it doesn't return a tuple hence the error