Common functions of Oralce SQL language (2) digital functions

Source: Internet
Author: User


Oralce SQL common functions (2) digital functions are input parameters for some arithmetic operations on digital data, output parameters are also the most commonly used numeric types. the structure of the TRUNC function is as follows:

The first parameter can be a field in the database table, or an expression. The second parameter n is the number of digits to be truncated. Note the following:

To master this function, you must master a virtual table named daul table www.2cto.com.

An example is as follows:
2. The structure of the ROUND function is as follows:

The first parameter used for rounding a specified value is the value to be rounding. It can be from a field in the database table. The second parameter represents the number of digits rounding. The considerations are as follows:
It is used in comparison with the TRUNC function as follows:
The following is an example of how to search the commodity table and rounding the commodity price in the search result:

 

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.