MySQL Common basic operating Syntax (12) ~ ~ Common numeric Functions "command line Mode"

Source: Internet
Author: User

Numeric functions are one of the most commonly used functions, and it is necessary to learn MySQL, which is commonly used as follows:
1. Ceil: Returns the smallest integer value greater than a number:

2. Floor: In contrast to the previous one, returns the maximum integer value less than a certain number:

3. Round: Returns the value after a value is rounded:

For example, the second parameter of round represents the number of decimal digits that need to be preserved.

4. Truncate: Returns the value after a value has been truncated:

Unlike round, the second parameter represents the number of decimal digits that need to be retained, regardless of the number of decimal digits that need to be left behind.

Note: The above examples are integers, but these functions can also handle negative numbers the same way. The numeric functions are more than these, but these few I personally think are more commonly used, so just record these few.

MySQL Common basic operating Syntax (12) ~ ~ Common numeric Functions "command line Mode"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.