--1 RAND () returns a random value from 0 to 1, the return value is different if no random seed is specified, and the same random value if the specified seed is the same
SELECT RAND ()
SELECT RAND ()
SELECT RAND (100)
SELECT RAND (100)
--Using Time (nanosecond) as a random seed drive
SELECT RAND (DATEPART (Ns,getdate ()))
--2 CEILING () Rounding of floating-point numbers, returning the maximum value, positive floating-point decimal one bit, negative floating-point decimal
SELECT CEILING (9.99999)
SELECT CEILING (-9.000001)
--3 floor () Rounding of floating-point numbers, returning the minimum integer, positive floating-point decimal, negative floating-point decimal into a
SELECT Floor (9.0000001)
SELECT Floor (-9.999999)
--4 ROUND () rounds a floating-point number, controlling the exact digits of the decimal point according to the second parameter
SELECT ROUND (4.444,2)
SELECT ROUND (4.445,2)
--5 ABS () take absolute value
SELECT ABS (-2)
SELECT ABS (2)
SELECT ABS (0)
--6 Power () takes the power value of an expression
SELECT POWER (2,5) --2^5
SELECT POWER (32,1.0/5) --32 open for 5 times
--7 sign () If a positive number returns 1, if a negative number is returned-1, if 0 is returned 0
SELECT sign (-2)
SELECT sign (2)
SELECT sign (0)
--8 SQRT (), requires that the number must be a positive integer
SELECT SQRT (16)
SELECT SQRT (-16)
Constant mathematical functions in SQL