【发布时间】:2020-05-27 20:54:56
【问题描述】:
这是我用来过滤具有单列变量的行及其工作的代码:
cur.execute("SELECT * FROM Table1 WHERE item1 LIKE ?", ('%'+item_name+'%', ))
n = cur.fetchall()
但我想用一个变量从多列中过滤行。 例如:表格有三列,分别为 item1、item2 和 item3。我想将行过滤为 select * from table1 where item1, item2 and item3。 如果可以的话,请告诉我怎么做?
【问题讨论】:
标签: python-3.x sqlite