列出postgres中的ROUND函数:
\df round
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+-------+------------------+---------------------+------
pg_catalog | round | double precision | double precision | func
pg_catalog | round | numeric | numeric | func
pg_catalog | round | numeric | numeric, integer | func
round的参数必须是双精度、数字、整数.
select 6::float/3.3 as number;
number
--------------------
1.8181818181818183
(1 row)
如果其数据类型为双精度:
select round(6::float/3.3,4) as number;
ERROR: function round(double precision, integer) does not exist
LINE 1: select round(6::float/3.3,4) as number;
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Time: 0.517 ms
除法的结果是哪种数据类型-1.8181818181818183
?