1

I want to compare two tables based on their total number of rows. So i use count(*) to count the total number of rows in both table.

My code is:

cur1.execute ("""SELECT COUNT(*) FROM mytable;""")

In order to store the total count return by this query,

I use

row = cur1.fetchone()

 result1 =  row[0] 

but it didn't help. Can anyone suggest me the solution?

Rohita Khatiwada
  • 2,835
  • 9
  • 40
  • 52

1 Answers1

1
cursor.fetchone() 

gives you the result directly..so no need to take its zeroeth element..what you want is given to you directly when you say:

row = cur1.fetchone()
Rafi
  • 805
  • 6
  • 12