Arithmetic Functions : Define Function « Function « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » Function » Define Function 
Arithmetic Functions
       

ABS(x)                        Calculates the absolute value (nonnegative number).
ACOS(x), ASIN(x)              Calculates the arcsin and arccos.
ATAN(x), ATAN2(x, y)          Calculates the arctangent.
CEILING(x)                    Rounds up to the least integer greater than or equal to x.
COS(x)                        Calculates the cosine; x is given in radians.
COT(x)                        Calculates the cotangent.
DEGREES(x)                    Converts radians to degrees (multiplication by 180/pi).
EXP(x)                        Returns e^x.
FLOOR(x)                      Rounds down to the greatest integer less than or equal to x.
LOG(x)                        Returns the natural logarithm (i.e., to base e).
LOG10(x)                      Returns the logarithm to base 10.
MOD(x, y)                     Returns the mod function, equivalent to x % y.
PI( )                         Returns 3.1415927.
POW(x, y)                     Returns x^y.
POWER(x, y)                   Equivalent to POW(x, y).
RADIANS(x)                    Converts degrees into radians (multiplication by Pi/180).
RAND( )                       Returns a random number between 0.0 and 1.0.
RAND(n)                       Returns a reproducible (thus not quite randomnumber.
ROUND(x)                      Rounds to the nearest integer.
ROUND(x, y)                   Rounds to y decimal places.
SIGN(x)                       Returns -10, or depending on the sign of x.
SIN(x)                        Calculates the sine.
SQRT(x)                       Calculates the square root.
TAN(x)                        Calculates the tangent.
TRUNCATE(x)                   Removes digits after the decimal point.
TRUNCATE(x, y)                Retains y digits after the decimal point (thus TRUNCATE(1.2364392returns 1.23).

   
    
    
    
    
    
    
  
Related examples in the same category
1.Define function in C and call by SQL
2.Comparison Functions,Tests, Branching
3.Calculating, Formatting, and Transformation Functions
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.