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
Returns the positive remainder after dividend / divisor.
Syntax
pmod(dividend, divisor)
Arguments
dividend: An expression that evaluates to a numeric.divisor: An expression that evaluates to a numeric.
Returns
If both dividend and divisor are of DECIMAL the result matches the type of divisor.
In all other cases a DOUBLE.
If divisor is 0, Azure Databricks raises a REMAINDER_BY_ZERO error.
Common error conditions
Examples
> SELECT pmod(10, 3), mod(10, 3);
1 1
> SELECT pmod(-10, 3), mod(-10, 3);
2 -1
> SELECT pmod(-10, 0);
Error: REMAINDER_BY_ZERO