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
Expression
is of typeNUMBER
, the data type returned isNUMBER
with maximum precision and scale. IfExpression
is of typeBINARY_FLOAT
, the data type returned isBINARY_FLOAT
. Otherwise, the data type returned isBINARY_DOUBLE
. -
If
Expression
is of typeNUMBER
, the value ofExpression
cannot be negative. -
If
Expression
resolves to a binary floating-point number (BINARY_FLOAT
orBINARY_DOUBLE
):-
If the value of the
Expression
is> = 0
, the result is positive. -
If the value of the
Expression
is= -0
, the result is-0
. -
If the value of the
Expression
is< 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.