Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle numerical function

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report