Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Sql-functions Mysql Mod Function

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Mod Function

Advertisement
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)

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 16, 2009

Related Tutorials

Discuss: Mysql Mod Function  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com