我有一个列表的列表:myList = [[123, 345], [23, 45], [54, 34]] 我想要做这样的事情: cursor.executemany("update tablename set flag = 'yes' where id = %s and officeid = %s", myList)
我搜索,发现这个无解。如果它永远不会实现,那么什么是更好的更新语句,而不必遍历
我试图使用psycopg2 executemany一个简单的多插入,但我只能使其工作字典使用,而不是“普通”值序列: # given:
values = [1, 2, 3] ; cursor = conn.cursor()
# this raises TypeError: 'int' object does not support indexing:
cursor.executemany(