G
Gilles Ganault
Hello
I'm getting some unwanted result when SELECTing data from an SQLite
database:
======
sql = 'SELECT id FROM master'
rows=list(cursor.execute(sql))
for id in rows:
sql = 'SELECT COUNT(code) FROM companies WHERE code="%s"' % id[0]
result = list(cursor.execute(sql))
print "Code=%s, number=%s" % (id[0],result[0])
======
Code=0111Z, number=(47,)
======
I expected to see "number=47". Why does Python return "(47,)"?
Thank you.
I'm getting some unwanted result when SELECTing data from an SQLite
database:
======
sql = 'SELECT id FROM master'
rows=list(cursor.execute(sql))
for id in rows:
sql = 'SELECT COUNT(code) FROM companies WHERE code="%s"' % id[0]
result = list(cursor.execute(sql))
print "Code=%s, number=%s" % (id[0],result[0])
======
Code=0111Z, number=(47,)
======
I expected to see "number=47". Why does Python return "(47,)"?
Thank you.