is_decimal 函数
检查某个值是否为小数。对于非浮点的数字,is_decimal 函数返回 true。对于任何其他值,包括 null,该函数返回 false。
is_decimal 函数是一个 is_bigint 的超集。
语法
is_decimal (super_expression)
Arguments
- super_expression
-
SUPER 表达式或列。
返回值
布尔值
示例
以下查询显示了 is_decimal 函数。
CREATE TABLE t(s super); INSERT INTO t VALUES (1.22); SELECT s, is_decimal(s) FROM t; s | is_decimal ------+------------ 1.22 | True (1 row)