【发布时间】:2021-08-18 20:59:31
【问题描述】:
我想检查该 ID 是否已经存在,但出现此错误:
Not all parameters were used in the SQL statement
代码:
Id = "TEST"
sql = """SELECT * FROM musics WHERE Id = %s"""
dbc.execute(sql, Id)
row = cursor.rowcount
if row == 0:
#NOT EXSIST
【问题讨论】:
-
你需要把
Id放在一个元组中。