Returns the positive square root of a positive number.
SQRT ( float_expression )
float_expression
Is an expression of the float
or integer
data type. It can be a constant, a variable, or a column.
Returns the positive square root of a positive number. The data type of the return value is float
.
If the input expression is negative, SQRT
returns NULL.
SQRT
returns NULL if the input value is NULL.SQRT
returns NULL if the input value is negative.SELECT SQRT(100.00);
Result:
10.00
SELECT SQRT(-50.00);
Result:
NULL
SELECT ProductID, ProductName, SQRT(Price) AS SquareRootOfPrice FROM Products WHERE Price > 0;