## 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. 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 ```