【发布时间】:2020-06-11 10:28:19
【问题描述】:
我正在尝试在 Python 中运行 SQL 脚本,其中我在 where 子句中传递了一个变量,如下所示:
cursor.execute(f"""select * from table where type = variable_value""")
在上述查询中,variable_value 具有我试图在 where 子句中使用的值。但是我收到一个错误psycopg2.errors.UndefinedColumn: column "variable_value" does not exist in table
【问题讨论】:
标签: python amazon-redshift psycopg2