This is an old revision of the document!


Omnidex SQL Function: MOD

Description

Returns “x modulus y”. This is the integral remainder of x divided by y.

This function returns an INTEGER datatype.

Syntax

MOD( integral_expression, divisor_integral_expression )

integral_expression % divisor_integral_expression
integral_expression

Required. Any expression that returns a integer-class datatype. This value will be divided by the divisor_integral_expression.

divisor_integral_expression

Required. Any expression that returns a integer-class datatype. This value will be divided into the integral_expression.

Example

Example 1: Column using MOD

> select population, mod(population, 100) from country_census;

POPULATION              MOD(COUNTRY_CENSUS.POP
----------------------  ----------------------
              28846761                      61
              30007094                      94
             248709873                      73
             285230516                      16

Example 2: Column using %

> select population, population % 100 from country_census;

POPULATION              POPULATION % 100
----------------------  ----------------------
              28846761                      61
              30007094                      94
             248709873                      73
             285230516                      16

Additional Resources

See also:

 
Back to top
dev/sql/functions/mod.1278706421.txt.gz · Last modified: 2016/06/28 22:38 (external edit)