mod(x, y): Returns the remainder (modulus) when dividing x / y : mod « Math Functions « PostgreSQL






mod(x, y): Returns the remainder (modulus) when dividing x / y


postgres=#
postgres=# -- mod(x, y): Returns the remainder (modulus) when dividing x / y
postgres=# SELECT mod(5, 5) AS no_remainder,
postgres-#        mod(6, 5) AS remainder_one,
postgres-#        mod(19, 5) AS remainder_four;
 no_remainder | remainder_one | remainder_four
--------------+---------------+----------------
            0 |             1 |              4
(1 row)

postgres=#
           
       








Related examples in the same category

1.mod(y, x) remainder of y/x