【发布时间】:2021-02-13 00:42:33
【问题描述】:
python 代码:
if aggregate_name and aggregate_value and aggregate_type:
query = "SELECT SUM(country) FROM soubhagyasalesdata GROUP BY ordernumber"
print(query)
else:
query = "SELECT * FROM {}".format(table_name)
错误:
UndefinedFunction at /api/datasets/reports/
function sum(text) does not exist
LINE 1: SELECT SUM(country) FROM soubhagyasalesdata GROUP BY ordernu...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
我在这里尝试使用 python 从我的 postgres 数据库中查询 但是,我正在处理错误。
请看一下
【问题讨论】:
-
你想做什么?
country是字符串,不能求和。
标签: python sql postgresql count aggregate-functions