我想检索Sqlite3数据库的前100行:
connection = sqlite3.connect('aktua.db')
cursor = connection.cursor()
print('Actual \tCliente \tHistórica')
cursor.execute("SELECT * FROM Referencias WHERE r_aktua LIKE '%K'").fetchmany(size=100)
for row in cursor:
print('%s \t%s \t%s' % row)
cursor.close()
connection.close()
我的代码检索数据库的所有行(+4000)。
我读过sqlite3.Cursor.fetchmany Docs和{a2}。在
怎么了?在
使用此选项可限制sql选择:
或者更改您的代码:
^{pr2}$相关问题 更多 >
编程相关推荐