python - Get row count in MySQLdb -
is there better way row count doing following?
cursor.execute("select distinct(provider_id) main_iteminstance") num_items = len(cursor.fetchall()) is there shorthand in mysqldb above?
you execute following sql directly on cursor.execute rather depending on mysqldb:
cursor.execute("select count(distinct provider_id) main_iteminstance") then result query.
Comments
Post a Comment