我正在使用AR的sum方法进行查询,在使用PostgreSQL时看到此错误:
PGError: ERROR: function sum(character varying) does not exist
LINE 1: SELECT sum("assets".asset_file_size) AS sum_asset_file_size ...
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT sum("assets".asset_file_size) AS sum_asset_file_size FROM "assets" [0m
我在使用MySQL的代码中使用了以下内容:
Asset.sum(:asset_file_size)
我错过了什么?