Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle numerical function

Shulou Source: shulou.com Published: 2022-06-01 13:50:43 11月10日 Update

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.

Tags: Function numeric value decimal result maximum minimum rounded three parameters decimal point average maximum positive or negative divisor absolute quad grouping work contact Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi OPPO Reno MySQL Xiaomi