This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing an essential Modul mathematical function of PostgreSQL.
The modulo operation returns the remainder after the division of the first argument by the second one.
PostgreSQL provides MOD() for performing the Modulo Operations.
Please check the below samples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
SELECT MOD(16,3) modulo; modulo --------- 1 SELECT MOD(30,10) modulo; modulo --------- 0 SELECT MOD(30,4) modulo; modulo --------- 2 SELECT MOD(-30,4) modulo; modulo --------- -2 |
Leave a Reply