Jump to: navigation, search

PostgreSQL MOD

From w3cyberlearnings

Contents

Postgresql MOD

This function returns the remainder of X divided by Y.

Syntax MOD

  • X is dividend
  • Y is divisor
MOD(X,Y);

OR 

X % Y



Example 1

postgres=# SELECT MOD(204,10);
 mod 
-----
   4
(1 row)


Example 2


postgres=# SELECT 200 % 45;
 ?column? 
----------
       20
(1 row)

Related Links



Navigation
Web
SQL
MISC
References