Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Casts the value expr to DECIMAL. This function is a synonym for CAST(expr AS decimal(10, 0)). See cast function for details.
Syntax
decimal(expr)
Arguments
expr: An expression that can be cast to DECIMAL.
Returns
The result is DECIMAL(10, 0).
If expr is a STRING that cannot be parsed as a number, Azure Databricks raises a CAST_INVALID_INPUT error. If the value exceeds the precision of the result, Azure Databricks raises a NUMERIC_VALUE_OUT_OF_RANGE error.
Common error conditions
Examples
> SELECT decimal('5.2');
5
> SELECT decimal('abc');
Error: CAST_INVALID_INPUT