Take the whole function:
1. Trunc (value,precision) intercepts a number by precision (precision) and does not perform rounding operations.
Returns the X value of the truncated to Y decimal places: Trunc (X,[y]):
select trunc(23.33) ------------23
2, round (value,precision) input the value [rounding rounding] according to the given precision (precision).
Returns the x value of the Y-bit rounded to the right of the decimal point: Round (X,[y]):
select round(23.33) ------------23
3, ceiling (value) produces the smallest integer greater than or equal to the specified value (value) [Rounding up].
Returns the largest integer greater than or equal to x:
select ceiling(23.33) -----------24
4. Floor (value), in contrast to ceiling (), produces the smallest integer that is less than or equal to the specified value (value) [rounded down].
Returns the largest integer equal to or less than x:
select floor(23.33) ------------23
5. Sign (value) is opposite to the absolute value function abs (). ABS () gives the amount of the value rather than its symbol, and sign (value) gives the value a symbol rather than a quantity.
Returns the symbol for x:
select sign(-23.33) -------------1
Summarize:
Round rounding: Round ()
"Rounding Down": Floor (), cast (x as int). Cast, Floor (cast (date as float) should not be used for the days of the pick date
"Rounding Up": CEILING ()
"Take Decimal": X-floor (x)
Rounding functions in SQL, taking decimals