使用python数据集模块从postgres数据库查询数据时遇到一些困难,当我查询数据时,我的数据是类型varchar,我收到以下错误。
错误:
LINE 1:...来自sources.product,其中post = 31055183 ...
提示:没有运算符匹配给定的名称和参数类型。您可能需要添加显式类型转换。 [SQL:'select * from sources.product where post = 310551835']
使用的代码片段
deltas = db.query('select * from deltas.deltas_del')
for idx in deltas:
print type(idx['post'])
prod = db.query('select * from sources.product where post = 310551835')
答案 0 :(得分:0)
在where子句右侧的值中添加引号,因为您要通过varchar进行过滤。
progressCycleDuration