sqlite3-如何通过多个SET和WHERE变量更新一行

时间:2018-08-16 01:36:38

标签: sqlite python-3.5

我尝试使用多个变量在SQlite3中通过以下表达式更新行:

    sql = "UPDATE table SET column1 = ?, column2 = ?, column3 = ? WHERE field1 = ? AND field2 = ? AND field3 = ?";

    parameters = (value1, value2, value3, value4, value5, value6)

    cursor.execute(sql, parameters)

但是我遇到了以下错误:

    (<class 'sqlite3.ProgrammingError'>, ProgrammingError('Incorrect number of bindings supplied. The current statement uses 3, and there are 6 supplied.',)

我如何实现该更新?

最好的问候

0 个答案:

没有答案