小编Tsa*_*chi的帖子

Python/pg8000 WHERE IN 语句

在 SQL 语句中通过 %s 获得元组(名称)的正确方法是什么?

names = ('David', 'Isaac')
sql = 'SELECT * from names WHERE name IN %s'
cur.execute(sql,(names,))
Run Code Online (Sandbox Code Playgroud)

/sf/answers/1968236091/中的响应适用于 psycopg2,但不适用于 pg8000。

谢谢!

python where-in python-db-api pg8000

4
推荐指数
1
解决办法
1389
查看次数

标签 统计

pg8000 ×1

python ×1

python-db-api ×1

where-in ×1