Skip to main content

MODULO

Returns the remainder of x divided by y. If y is 0, it returns an error.

Syntax​

MODULO( <x>, <y> )

Aliases​

Examples​

SELECT MOD(9, 2), MODULO(9, 2);

┌──────────────────────────┐
│ mod(9, 2) │ modulo(9, 2) │
├───────────┼──────────────┤
│ 1 │ 1 │
└──────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today