Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Mysql Math Function 
 

Math Function involved in Mysql when we perform some operation on mathematical operator

 

Mysql Math Function

                         

Math Function involved in Mysql when we perform some operation on mathematical operator

Understand with Example

The Tutorial illustrate an example from 'Mysql Math Function'. The below Syntax help you to perform Math Function :

ABS(X): This is used to Returns the absolute value of X.

Query:

The Query abs(12) is used to return the absolute value of 12 as fieldname 'AbsoluteValue'.

 

 

mysql> select abs(12)as AbsolutValue;
+--------------+
| AbsolutValue |
+--------------+
|           12 |
+--------------+
1 row in set (0.00 sec)

Query:

mysql> select abs(-12)as AbsolutValue;
+--------------+
| AbsolutValue |
+--------------+
|           12 |
+--------------+
1 row in set (0.00 sec)

ACOS(1):This is used to returns the arc cosine of 1, that is, the value whose cosine is 1

mysql>  SELECT ACOS(1)as Arccosine;
+-----------+
| Arccosine |
+-----------+
|         0 |
+-----------+
1 row in set (0.02 sec)

ASIN(0.1):This is used to returns the arc sine of X, that is, the value whose sine is X

mysql>  SELECT ACOS(0.1)as Arcsine ;
+-----------------+
| Arcsine         |
+-----------------+
| 1.4706289056333 |
+-----------------+
1 row in set (0.00 sec)

ATAN(1):This is used to returns the arc tangent of 1, that is, the value whose tangent is 1.

mysql>  SELECT ATAN(1)as Arctangent  ;
+------------------+
| Arctangent       |
+------------------+
| 0.78539816339745 |
+------------------+
1 row in set (0.00 sec)

ATAN(-2,2):This is used to returns the arc tangent of the two variables -2 and 2.

mysql> SELECT ATAN(-2,2)as  Arctangent;
+-------------------+
| Arctangent        |
+-------------------+
| -0.78539816339745 |
+-------------------+
1 row in set (0.00 sec)

CEILING(2.23):This is used to returns the smallest integer value not less than 2.23.

mysql> SELECT CEILING(2.23)as SmallestInteger;
+-----------------+
| SmallestInteger |
+-----------------+
|               3 |
+-----------------+
1 row in set (0.00 sec)

COS(0):This is used to returns the cosine of 0, where 0 is given in radians.

mysql> SELECT COS(0)as Cosine;
+--------+
| Cosine |
+--------+
|      1 |
+--------+
1 row in set (0.00 sec)

COT(45):This is used to returns the cotangent of 45.

mysql>  SELECT COT(45)as cotangent ;
+------------------+
| cotangent        |
+------------------+
| 0.61736962378356 |
+------------------+
1 row in set (0.00 sec)

CRC32(expr):This query Computes a cyclic redundancy check value and returns a 32-bit unsigned value.

mysql> SELECT CRC32('Girish')as CRCVALUE;
+------------+
| CRCVALUE   |
+------------+
| 4143371692 |
+------------+
1 row in set (0.03 sec)

DEGREES(180):This is used to returns the argument PI( ), converted from radians to degrees.

mysql> SELECT DEGREES(PI())as DEGREE;
+--------+
| DEGREE |
+--------+
|    180 |
+--------+
1 row in set (0.00 sec)
mysql> SELECT DEGREES(PI()/2)as DEGREE;
+--------+
| DEGREE |
+--------+
|     90 |
+--------+
1 row in set (0.00 sec)

EXP(0):This is used to returns the value of e (the base of natural logarithms) raised to the power of  0.

mysql> SELECT EXP(0)as evalue;
+--------+
| evalue |
+--------+
|      1 |
+--------+
1 row in set (0.00 sec)

FLOOR(3.63):This is used Returns the largest integer value not greater than 3.63.

mysql> SELECT FLOOR(3.63)as largestIntegerValue;
+---------------------+
| largestIntegerValue |
+---------------------+
|                   3 |
+---------------------+
1 row in set (0.00 sec)

LOG(2):-returns the natural logarithm of 2.

mysql>  SELECT LOG(2)as LogValue;
+------------------+
| LogValue         |
+------------------+
| 0.69314718055995 |
+------------------+
1 row in set (0.00 sec)

LOG10(1OO):Returns the base-10 logarithm of 100.

mysql> SELECT LOG10(100)as base10value;
+-------------+
| base10value |
+-------------+
|           2 |
+-------------+
1 row in set (0.00 sec)

ROUND(1.9814,2):Rounds the argument (1.9814,2) to Ddecimal places

mysql> SELECT ROUND(1.9814, 2)as RoundedValue;
+--------------+
| RoundedValue |
+--------------+
|         1.98 |
+--------------+
1 row in set (0.00 sec)

SQRT(49):Returns the square root of a non-negative number 49.

mysql> SELECT SQRT(49)as SquareRoot;
+------------+
| SquareRoot |
+------------+
|          7 |
+------------+
1 row in set (0.00 sec)

                         

» View all related tutorials
Related Tags: sql mysql c table sed tab if ie record records to ci e use trie pe from m tr spec

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.