Below table summarize the mathematical functions.
Function |
Description |
Example |
Return absolute value of a number. |
SELECT name,abs(rating) from emp; |
|
Return arc cosine value of n. |
SELECT name,acos(rating) from emp; |
|
Return arc sin value of n |
SELECT name,asin(rating) from emp; |
|
Return arc tangent of a number |
SELECT atan(109); |
|
Return number in binary format. |
SELECT name,gender_age.age,bin(gender_age.age) from emp; |
|
Return ceiling value of n |
SELECT rating,ceil(rating),ceiling(rating) from emp; |
|
Convert number from one base to other base |
SELECT name,gender_age.age,conv(gender_age.age,10,2) FROM emp;
|
|
Return cosine of the value. |
SELECT rating,cos(rating) FROM emp; |
|
Convert radians to degrees. |
SELECT degrees(90); |
|
e() |
Return the value of e. |
SELECT e(); |
Return e to the power n. |
SELECT rating,exp(rating) FROM emp; |
|
Return floor of this value. |
SELECT rating, floor(rating) FROM emp; |
|
Return hexadecimal of this number |
SELECT gender_age.age,hex(gender_age.age) FROM emp; |
|
Convert each character into hexadecimal format. |
SELECT hex('ABC'); |
|
Return natural log of a number |
SELECT ln(1.23); |
|
return logarithm of a number |
SELECT 1000, log(1000, 10); |
|
Return base-2 logarithm of the number n. |
SELECT log2(10); |
|
Return base 10 logarithm of a number |
SELECT log10(100); |
|
Negate the number, return -n |
SELECT negative(10); |
|
Return the value of pi |
SELECT pi() |
|
Return positive modulus of a number |
SELECT PMOD(10, 3); |
|
This method return n. |
select positive(10); |
|
Return m to the power n |
SELECT pow(10, 2); |
|
Convert degrees to radins |
SELECT radians(5156.620156177409); |
|
Return random number |
SELECT rand(1000); SELECT rand(); |
|
round the double to n integer places |
SELECT round(10.09872); |
|
Return sign of a number. If the number is -ve, it return -1.0, for positive it return 1.0, 0.0 otherwise. |
SELECT sign(10); |
|
Return sin of a number |
SELECT sin(10.09); |
|
Square root of a number. |
SELECT sqrt(16); |
|
Return tangenet of a number. |
SELECT tan(90); |
|
Inverse of hex function |
SELECT unhex('ABCDDF'); |
Previous Next Home
No comments:
Post a Comment