3
Python / psycopg2 WHERE IN语句
通过SQL语句中的%s提供列表(countryList)的正确方法是什么? # using psycopg2 countryList=['UK','France'] sql='SELECT * from countries WHERE country IN (%s)' data=[countryList] cur.execute(sql,data) 现在,尝试运行“(ARRAY [...])所在的国家/地区”后,它会出错。除了通过字符串操作之外,还有其他方法吗? 谢谢