H I O X INDIA
MySQL Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Mysql Tutorial
Introduction
How to Install
Database
Datatypes
Tables
INSERT
SELECT
UPDATE
DELETE
Operators
Functions
Ask Your Doubts
Feedback





Numeric functions


Topic

Numeric functions in MySQL.
What are the Math Functions?



Explanation


Mathematical Functions :

    Now lets see some Mathematical functions with an example.

DEGREES(X) :

    This function returns the argument X, converted from radians to degrees.

mysql> select degrees(pi());
 -->  180

mysql> select degrees(0.78539816339745);
 -->  45
EXP(X) :

    Returns the value of the base of natural logarithms(e) raised to the power of X.
mysql> select exp(-1);
 -->  0.36787944117144

mysql> select exp(1);
 -->  2.718281828459
FLOOR(X) :

    Returns the largest integer value not greater than X.
mysql> select floor(5.68);
 -->  5

mysql> select floor(-1.26);
 -->  2
FORMAT(X,D) :

    Formats the given number in a ##,###.## format,rounded to D decimal places.
mysql> select format(7895423.23478,2);
 -->  7,895,423.23

mysql> select format(1287654.458,0);
 -->  1,287,654
LN(X) :

    Returns the natural logarithm of X, the base-e logarithm of X.
mysql> select ln(3);
 -->  1.0986122886681

mysql> select ln(-1);
 -->  NULL
LOG(X) :

    This function returns the natural logarithm of X, if it contains a single parameter.
mysql> select log(1);
 -->  0

mysql> select log(-2);
 -->  NULL
LOG(B,X) :

    If it contains two parameters, then returns the natural logarithm of X for an arbitrary base B .
mysql> select log(3,4512);
 -->  7.659204143237

mysql> select log(1,250);
 -->  NULL




others


        MySQL is the most popular open source database Management system. Being a open source anyone can use and change the software for their needs. Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this MySQL tutorial. This is a copyright content.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links