In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the introduction of mathematical functions commonly used in mysql. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
The mathematical functions of mysql are:
1. The absolute value function ABS (X) and the function PI (X) that returns pi
ABS (X) returns the absolute value of X
PI () returns the value of pi, which displays the last 6 digits by default.
2. Square root function SQRT (X) and remainder function MOD (XQuery Y)
SQRT (X) returns the quadratic root of a non-negative number x
The remainder MOD (XQuery Y) returns the remainder of XUnip Y, and MOD () also works for values with small portions, which returns the exact remainder after the operation.
3. Get the integer functions CEIL (X), CEILING (X), and FLOOR (X)
CEIL (X) and CEILING (X) have the same meaning, returning a minimum integer value of not less than X, and the return value is converted to a BIGINT.
FLOOR (X) returns the maximum integer value not greater than X, and the return value is converted to a BIGINT
4. Get the functions RAN () and RAND (X) of random numbers.
A random floating point number V returned by RAND (X), ranging from 0 to 1
5. Functions ROUND (X), ROUND (Xpeny) and TRUNCATE (Xpeny)
Round (x) rounds the X value
Round (XBI y) retains the Y bit after the decimal point
Truncate (XQuery y) intercepts and retains the specified Y bit after the decimal point
6. Symbolic function SIGN (X)
Sign (X). If the value of x is negative, 0, or positive, the corresponding values are-1,0,1.
7. Power operation functions POW (Xpeny), POWER (Xpeny) and EXP (X)
POW and POWER are the multipliers of Y over the value of X.
EXP (X) is the multiplier of e
8. Logarithmic functions LOG (X) and LOG10 (X)
There is no need to explain this to everyone!
9. The functions RADIANS (X) and DEGREES (X) of the conversion between angle and Radian
RADIANS (X) converts X from angle to Radian
DEGREES (X) converts radians to angles
10. Sinusoidal and arcsine functions SIN (X) and ASIN (X)
Directly above the picture
11. CoSine function COS (X) and inverse cosine function ACOS (X)
Directly above the picture
12. Tangent, arc tangent, cotangent function
Directly above the picture
Be careful when using the functions that come with mysql, it will affect the efficiency of data execution, and the cost is too high. This should also be distinguished, and the reference categories of fast software should be distinguished. For example, the business logic of the internal system is relatively complex and the function points are very detailed, but the concurrency is not very large. At this time, using the functions included in MySQL can greatly reduce the difficulty of developing business logic (although it is one-sided and cannot be generalized, it is still very useful). The business logic of the external system is relatively not very complex, the function point is relatively shallow, but the concurrency is relatively large, in order to reduce the access pressure of the server and database, it is best not to use the built-in function, the reason is simply the performance problem.
This is the end of the introduction of mathematical functions commonly used in mysql. I hope the above content can be helpful to everyone and learn more knowledge. If you think the article is good, you can share it for more people to see.
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.