Home Sql Mysql-example Mysql Mod Function



Mysql Mod Function
Posted on: January 17, 2009 at 12:00 AM
Mysql Mod Function is used to return the remainder of N divided by M.

Mysql Mod Function

     

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)

 

Related Tags for Mysql Mod Function:
sqlmysqlcidedivfunctionfuniosedvireturnidaiunctoemainuseinmodmemfuncsurnmyisivdividessthndono


More Tutorials from this section

Ask Questions?    Discuss: Mysql Mod Function  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

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.