我通过Ruby gem'seququel'使用PostgreSQL.
我想要舍入到小数点后两位.
这是我的代码:
SELECT ROUND(AVG(some_column),2)
FROM table
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
PG::Error: ERROR: function round(double precision, integer) does
not exist (Sequel::DatabaseError)
Run Code Online (Sandbox Code Playgroud)
运行以下代码时,我没有收到任何错误:
SELECT ROUND(AVG(some_column))
FROM table
Run Code Online (Sandbox Code Playgroud)
有谁知道我做错了什么?