rounded up
1. Grammar
ROUND(n[,m])
Omit m: 0
m>0: m digits after the decimal point
m<0: m digits before the decimal point
n represents the value to be rounded.
m indicates the number of digits after or before the decimal point to be retained.
2. Examples
SQL>select round(23.4),round(23.45,1),round(23.45,-1)from dual;
ROUND(23.4) ROUND(23.45,1) ROUND(23.45,-1)
----------------------------------------
2323.520
Two rounding function
1. Grammar
CEIL (n)
FLOOR(n)
2. Examples
- SQL>select ceil(23.45),floor(23.45)from dual;
CEIL(23.45) FLOOR(23.45)
-----------------------
2423
Three commonly used calculation functions
1. Grammar
ABS(n)
MOD(m,n): If there is a null value in m and n, the result returns null.
POWER(m,n): Indicates the n-th power of m.
SQRT(n): find the square root
2. Examples
- SQL>select abs(23.45),abs(-23),abs(0)from dual
2;
ABS(23.45) ABS(-23) ABS(0)
------------------------------
23.45230
SQL>select mod(5,2)from dual;
MOD(5,2)
----------
1
SQL>select mod(5,null)from dual;
MOD(5,NULL)
-----------
SQL>select power (2,3),power(null,3)from dual;
POWER(2,3) POWER(NULL,3)
-----------------------
8
SQL>select sqrt(16)from dual;
SQRT(16)
----------
4
Four trigonometric functions
1. Grammar
SIN (n) 、 ASIN (n)
COS(n)、ACOS(n)
TAN(n)、ATAN(n)
2. Examples
SQL>select sin(1.57)from dual;
SIN(1.57)
----------
.999999683