SQLite3 - 提供的绑定数量不正确

时间:2013-07-03 17:22:07

标签: python sqlite

我是SQL的新手,所以也许这是一个新手问题。但这是我的简单代码(也是,我正在使用python):

@classmethod
def next_page(cls):
    cls.cur.execute("SELECT * FROM Posts WHERE Id < 10 ORDER BY Date DESC Limit 10")
    rows = cls.cur.fetchall()

    return rows

当我运行时,我收到以下错误:

Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "database.py", line 20, in next_page
        rows = cls.cur.fetchall()
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied

任何人都知道与此有什么关系?任何帮助表示赞赏

1 个答案:

答案 0 :(得分:0)

结果(因为我在REPL中运行代码)你必须CTRL + C并在修改文件时再次输入REPL。

相关问题