简体   繁体   English

如何将 cursor.executemany 用于插入以外的其他操作

[英]How to use cursor.executemany for other operations than insertion

I have this code:我有这个代码:

c = conn.cursor()
l=[(A,B,C),]
c.executemany("SELECT * FROM 'my_table' WHERE code=? AND date BETWEEN ? AND ? ORDER BY date",l) 
r = c.fetchall()

how can I make it work ?我怎样才能让它工作? Is there any other alternatives ?还有其他选择吗?

c = conn.cursor()
l = (A, B, C)
c.execute("SELECT * FROM 'my_table' WHERE code=? AND date BETWEEN ? AND ? ORDER BY date", l)
r = c.fetchall()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM