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 SMALLINT. This function is a synonym for CAST(expr AS SMALLINT). See cast function for details.
Syntax
smallint(expr)
Arguments
expr: Any expression which is castable toSMALLINT.
Returns
The result is SMALLINT.
If expr is a STRING that cannot be parsed as a number, Azure Databricks raises a CAST_INVALID_INPUT error. If the value overflows the SMALLINT range, Azure Databricks raises a CAST_OVERFLOW error.
Common error conditions
Examples
> SELECT smallint(-5.6);
5
> SELECT smallint('5');
5
> SELECT smallint('abc');
Error: CAST_INVALID_INPUT