Numerical function is one of the commonly used functions, and it is also a must for learning mysql. The commonly used ones are as follows:
1. ceil: Returns the smallest integer value greater than a certain number:
2. Floor: Contrary to the previous one, returns the largest integer value less than a certain number:
3. Round: Returns a certain value after rounding. The value of:
As shown above, the second parameter of round represents the number of decimal places that need to be retained.
4. Truncate: Returns the truncated value of a certain value:
The difference here from round is that no matter what the next decimal place is that needs to be retained, will be discarded directly. The same second parameter represents the number of decimal places that need to be retained.
Note: The above examples are all integers, but these functions can also handle negative numbers in the same way. There are more than these numerical functions, but I personally think these are more commonly used, so only these are recorded.
Numerical function is one of the commonly used functions, and it is also a must for learning mysql. The commonly used ones are as follows:
1. ceil: Returns the smallest integer value greater than a certain number:
2. Floor: Contrary to the previous one, returns the largest integer value less than a certain number:
3. Round: Returns the rounded value of a certain value:
As shown above, the second parameter of round represents the number of decimal places that need to be retained.
4. Truncate: Returns the truncated value of a certain value:
The difference here from round is that no matter what the next decimal place is that needs to be retained, will be discarded directly. The same second parameter represents the number of decimal places that need to be retained.
Note: The above examples are all integers, but these functions can also handle negative numbers in the same way. There are more than these numerical functions, but I personally think these are more commonly used, so only these are recorded.
The above is the content of the common basic operation syntax of mysql (12)~~common numerical functions [command line mode]. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!