此代码适用于我,直到我放入另一个参数替换,特别是" SET"之后的那个。这里有什么简单的东西吗?任何帮助或建议都会很棒!
for i, item in enumerate(items[0]):
print item,number_sold[0][i],date
c.execute("UPDATE stock SET (?) = (?) WHERE date IN (?)",[item,number_sold[0][i],date])
c.commit()
错误:
---> 51 c.execute("UPDATE stock SET (?) = (?) WHERE date IN (?)",[item,number[0][i],date])
52 c.commit()
OperationalError: near "(": syntax error
打印"项目,编号[0] [i],日期"给了我" Cake,3,735719.0"这是我所期待的。