Oracle numerical function
Sort out the commonly used oracle value-related functions:
Divisor (rounded): round () for example, keeping two decimal places after the decimal point: select round (3.2233prime2) from dual returns the result 3.22.
Find the average: avg ()
Find the maximum: max ()
Find the minimum: min ()
Count: count ()
Sum: sum () these five are all grouping functions.
Absolute value: abs () for example: select abs (- 3) from dual returns a value of 3.
Round up: ceil () for example: select ceil (3. 2) from dual,select ceil (3. 6) from dual returns values of 4. 0.
Round down: floor () for example: select ceil (3. 2) from dual,select ceil (3. 6) from dual returns a value of 3. 0.
Rounding: trunc () intercepts a portion of the value. For example, select trunc (3. 75) from dual returns a result of 3. 0.
Sign (n) if n is greater than 0 returns 1, less than 0 returns-1, equals 0, returns 0.
I came across a new oracle function, NVL2 (), which is an extension of NVL () at work today. It takes three parameters, NVL2 (exper1,exper2,exper3) if exper1 is empty, then exper3 is returned. If exper1 is not empty, then return exper2.