MySQL offers many built-in numeric functions. MySQL numeric function can be categorize as Arithmetic Operators and Mathematical Functions.
Function | Description |
---|---|
ABS() | Return the absolute value of a number |
ACOS() | Return the arc cosine of a number |
ASIN() | Return the arc sine of a number |
ATAN() | Return the arc tangent of a number |
ATAN2(), ATAN() | Return the arc tangent of the two arguments |
CEIL() | Return the smallest integer value not less than the number |
CEILING() | Return the smallest integer value not less than the number |
CONV() | Convert numbers between different number bases |
COS() | Return the cosine of a number |
COT() | Return the cotangent of a number |
CRC32() | Compute a cyclic redundancy check value |
DEGREES() | Convert radians to degrees |
DIV | Used for integer division |
/ | Used as division operator |
EXP() | Raise to the power of number |
FLOOR() | Return the largest integer value not greater than the number |
LN() | Return the natural logarithm of the number |
LOG() | Return the natural logarithm of the first number |
LOG10() | Return the base-10 logarithm of the number |
LOG2() | Return the base-2 logarithm of the number |
- | Used as minus operator |
MOD() | Returns the remainder of a divided by b |
%, MOD | Used as modulo operator |
PI() | Return the value of pi |
+ | Used as addition operator |
POW() | Return the number raised to the specified power |
POWER() | Return the number raised to the specified power |
RADIANS() | Return number converted to radians |
RAND() | Return a random floating-point value |
ROUND() | Round the number |
SIGN() | Return the sign of the number |
SIN() | Return the sine of the number |
SQRT() | Return the square root of the number |
TAN() | Return the tangent of the number |
* | Used as multiplication operator |
TRUNCATE() | Truncate to specified number of decimal places |
- | Change the sign of the number |