比如说你需要更新一些数据到表中
但是你想知道我更新了多少条数据
insql = "update db set state=0 where state=1" cursor.execute(insql) connect.commit() print(cursor.rowcount) # 获取更新了多少条数据