Categories: Math
SQRT
Returns the square root of a non-negative numeric expression. Returns NaN for negative inputs. Returns NULL if the input is NULL.
Syntax
SQRT(numeric_expression double) → double
- numeric_expression: Numeric expression to calculate the square root for.
Examples
SQRT exampleSELECT SQRT(25.25)
-- 5.024937810560445
SELECT SQRT(-25.25)
-- NaN
SELECT SQRT(NULL)
-- null
SQRT(numeric_expression int64) → double
- numeric_expression: Numeric expression to calculate the square root for.
Examples
SQRT exampleSELECT SQRT(25)
-- 5.0
SQRT(numeric_expression int32) → double
- numeric_expression: Numeric expression to calculate the square root for.
Examples
SQRT exampleSELECT SQRT(25)
-- 5.0
SQRT(numeric_expression float) → double
- numeric_expression: Numeric expression to calculate the square root for.
Examples
SQRT exampleSELECT SQRT(25.25)
-- 5.024937810560445
Usage Notes
If the input is a negative value, NaN is returned.