我尝试只在满足特定where条件的行(当Name列中的值等于给定名称时)的新列中插入值。
这是我目前编写的代码:
cours.execute("""INSERT INTO NewTable(Straight, Right, Left) WHERE Name = (?)
VALUES (?, ?, ?) """,
(name, DIRECTIONS['straight'], DIRECTIONS['right'], DIRECTIONS['left']))
conn.commit()
在我提交之后,我得到以下错误:
sqlite3.OperationalError:“地点”附近:语法错误
- 谢谢-谢谢
1条答案
按热度按时间blpfk2vs1#
尝试使用
UPDATE
语句: