SQL single-row functions in Oracle databases-numeric Functions
1. trigonometric Functions
SIN ASIN SINH
COS ACOS COSH
TAN ATAN TANH
For the above trigonometric functions, see the name. Do a continuous exercise [SQL] select sin (2), asin (1), SINH (1) from dual;
Select cos (1), ACOS (0.5), COSH (0.5) FROM dual;
Select tan (1), atan2 (2, 1), tanh (2) from dual; the above results are as follows:
2. mathematical functions
ABS (x): returns the absolute value of x.
BITAND (x, y): returns the result of the "and" operation on x and y. The returned result is 0 or 1 [SQL] <span style = "color: #000000; "> select abs (-2), bitand (1, 1) from dual; </span>
CEIL (x): returns the smallest integer greater than or equal to x (negative)
FLOOR (x): returns the largest integer of small and or equal to x [SQL] <span style = "color: #000000;"> select ceil (-20.5 ), ceil (20.5), floor (-20.5), floor (20.5) from dual; </span> EXP (x): returns the x power of e.
LN (x): returns the natural logarithm of x [SQL] select exp (2), ln (10) from dual; LOG (x, y ): returns the base-x logarithm of y.
POWER (x, y): returns the POWER y of x.
SQRT (x): returns the square root of x [SQL] SELECT LOG (10,100), POWER (), SQRT (4) FROM DUAL; MOD (x, y ): returns the remainder of x divided by y.
SIGN (x): returns the x symbol. If x is 0, 0 [SQL] select mod (), sign (0), sign (-2) from dual is returned; ROUND (x [, y]): returns the result of rounded up x. Y is an optional parameter, indicating the number of decimal places.
If y is not specified, x is rounded up to 0 decimal places. If x is negative, x is rounded up to the left of the decimal point. | y |
The rounding method is used.
TRUNC (x, [y]): similar to ROUND, but it simply removes the ending number. [SQL] SELECT ROUND (1234.5678), ROUND (1234.5678, 2), ROUND (1234.5678, -2) from dual;
Select trunc (1234.5678), TRUNC (1234.5678, 2), TRUNC (1234.5678,-2) from dual;
There are almost so many numeric functions. Over!