Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
APPLIES TO:
NoSQL
Returns the square root of the specified numeric value.
SQRT(<numeric_expr>)
Description | |
---|---|
numeric_expr |
A numeric expression. |
Returns a numeric expression.
The following example returns the square roots of various numeric values.
SELECT VALUE {
sqrtZero: SQRT(0),
sqrtOne: SQRT(1),
sqrtFour: SQRT(4),
sqrtPrime: SQRT(17),
sqrtTwentyFive: SQRT(25)
}
[
{
"sqrtZero": 0,
"sqrtOne": 1,
"sqrtFour": 2,
"sqrtPrime": 4.123105625617661,
"sqrtTwentyFive": 5
}
]
- This function doesn't use the index.
- If you attempt to find the square root value that results in an imaginary number, you get an error that the value can't be represented in JSON. For example,
SQRT(-25)
gives this error.