[英](psycopg2.errors.UndefinedColumn) column "name" does not exist
[英]Psycopg2.errors.Undifinedcolumn : column does not exist
我想在 python 上使用 where 但它说该列不存在。 我实际上有特定的列
name1 = input("Enter the
name"
query = 'select * from
"Job" where name =
{0}.format(name1)
cur.execute(query)
我猜您有问题,因为您没有在name1
周围使用引号。 因此name1
值被视为列名而不是过滤条件。
这应该做的工作:
name1 = input("Enter the name : ")
query = f'select * from "Job" where name = \'{name1}\''
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.