Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更新包含多行的sqlite上的表
tablenew id status a old b ask c old d old
ETC...
list = ['a', 'b', 'c'] cur.execute("update tablenew set status =? where id = ?", ('new',list))
如何在python中做到这一点?
使用IN运算符:
IN
cur.execute("update tablenew set status = ? where id IN ?", ('new', list))