My question may be quite simple. I need to make a sum of a column from my database. The problem is that (the way I do it), it brings me the data as rows and not as int. How do I get a data from the database as it is? Example:
def prueba():
consulta= ("SELECT x from y")
cur.execute(consulta)
registros=cur.fetchall()
for i in registros:
print i
I understand that fetchall shows me the data as rows, but in what way do I bring it as an integer to be able to operate it? I hope you have given me to understand, thank you very much.