---
title: "MOD"
description: "The MOD SQL function gets the remainder of a divide calculation."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/mod
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/mod
updated: 2026-10-08T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> MOD[MOD]:::quoted
    MOD --> End((END))
```

## Purpose
The `MOD` SQL function gets the remainder of a divide calculation.

See also [[REMAINDER]].

Parameters:
- dividend (`decimal`): a number.
- divider (`decimal`): a number other than 0; a divider of 0 raises an error, as a division by 0 does.

Returns: the remainder.

## Examples
The following example retrieves the remainder of 25 divided by 7:
```sql
select mod(25, 7)

-------------------
4
```
The following example retrieves the remainder of -8 divided by 17; the sign of the dividend is kept:
```sql
select mod(-8, 17)

-------------------
-8
```
The following example retrieves the remainder of 10 divided by 10:
```sql
select mod(10, 10)

-------------------
0
```