Mysql Mod Function is used to return the remainder of N divided by M.The Syntax used for Mysql Mod Function is given below:
SYNTAX:-Select MOD(N,M);
Returns the remainder of N divided by M.
Query for Modulo operation:
The Query given below MOD is used to return the remainder of 34 divided by 3 as fieldname 'MODULUS'.
mysql> SELECT MOD(34,3)as MODULUS; |
Output:-
+---------+ | MODULUS | +---------+ | 1 | +---------+ 1 row in set (0.00 sec) |
Query:-
mysql> select 11 mod 3 as MODULUS; |
Output:-
+---------+ | MODULUS | +---------+ | 2 | +---------+ 1 row in set (0.00 sec) |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Mysql Mod Function
Post your Comment