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: