为什么我在这段代码中收到错误no such column: test2
?看起来请求是正确的......
import sqlite3
db = sqlite3.connect('test.db')
cur = db.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS abc(test1 TEXT, test2 TEXT, test3 TEXT)")
cur.execute("INSERT INTO abc VALUES (test2)",('aaaaaa'))
db.commit()
db.close()
完整错误:
File "d:\programm\BotParsSale\test.py", line 11, in <module>
cur.execute("INSERT INTO abc VALUES (test2)",('aaaaaa'))
sqlite3.OperationalError: no such column: test2