SQRT
The SQRT function returns the square root of Expression.
SQL syntax
SQRT(Expression)Parameters
SQRT has the parameter:
| Parameter | Description |
|---|---|
|
|
Operand or column can be any numeric data type. |
Description
-
If
Expressionis of typeNUMBER, the data type returned isNUMBERwith maximum precision and scale. IfExpressionis of typeBINARY_FLOAT, the data type returned isBINARY_FLOAT. Otherwise, the data type returned isBINARY_DOUBLE. -
If
Expressionis of typeNUMBER, the value ofExpressioncannot be negative. -
If
Expressionresolves to a binary floating-point number (BINARY_FLOATorBINARY_DOUBLE):-
If the value of the
Expressionis> = 0, the result is positive. -
If the value of the
Expressionis= -0, the result is-0. -
If the value of the
Expressionis< 0, the result isNaN.
-
Examples
Use SQRT function to return the square root of the absolute value of -10. Then cast the value as BINARY_FLOAT.
Command> SELECT CAST (SQRT (ABS (-10)) AS BINARY_FLOAT ) FROM dual; < 3.162278 > 1 row found.