In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what are the digital functions in Oracle, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Digital function ROUND
The ROUND function rounds numeric values according to the specified decimal precision. Returns a value rounded up or down to the specified decimal precision based on a valid number. If the specified decimal precision is n, the valid data to be rounded is to the right of the decimal point (n = 1). If n is negative, the valid number to be rounded is in n positions to the right of the decimal point. If the data of valid data is greater than or equal to 5, it is rounded up and rounded down in other cases.
The ROUND function takes two parameters. Syntax: ROUND (source number,decimal precision). The source number parameter represents any numeric value. The decimal precision parameter specifies the precision of rounding, which is optional. If the decimal precision parameter is not specified, the default precision of rounding is 0, that is, the source number is rounded to the nearest integer.
Select round (1601.916pr 1) from dual
Select round (1601.916pr 2) from dual
Select round (1601.916) from dual
Select round (1601.916) from dual
Select round (1601.916) from dual
TRUNC
The TRUNC function performs an intercept operation on the data based on the specified decimal precision. Numerical truncation is different from rounding. If the decimal precision is positive, the last value deletes the number according to the specified decimal precision and does not round up or down. However, if the specified decimal precision (n) is negative, the input value returns 0 from the nth digit to the left of the decimal point.
The TRUNC function takes two parameters. Syntax: TRUNC (source number,decimal precision). Source number represents any numeric value. Decimal precision specifies the precision of the intercept, which is optional. If the decimal precision parameter is not specified, the default precision is 0, which means that source number truncates to the nearest integer.
Select trunc (1601.916pr 1) from dual
Select trunc (1601.916pr 2) from dual
Select trunc (1601.916) from dual
Select trunc (1601.916) from dual
Select trunc (1601.916) from dual
MOD
The MOD function returns the remainder of the division operation. Provide two numbers, the divisor and the divisor, and perform the division operation. If the divisor is the divisor, MOD returns 0 because there is no remainder. If the divisor is equal to 0, a no division by zero error is returned, and the MOD function also returns 0. If the divisor is greater than the divisor, the MOD function returns the divisor as a result.
The MOD function takes two parameters. Syntax: MOD (dividend,divisor). Both dividend and divisor parameters can represent numeric literals, columns, or expressions. It can be positive or negative.
Select mod (6 dint 2) from dual
Select mod (5BI 3) from dual
Select mod (7 and 35) from dual
Select mod (5.2) from dual
Select mod (- 5pm 3) from dual
The MOD function is usually used to distinguish between odd and even numbers.
These are all the contents of the article "what are the digital functions in Oracle?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.