Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the square root of a given number, accurate to within the representation of doubles.
SQRT ( number )
Float or double. If number is is zero, returns 0. If less than 0, returns NULL
.
SELECT SQRT(-2);
+----------+
| SQRT(-2) |
+----------+
| NULL |
+----------+
SELECT SQRT(2);
+--------------------+
| SQRT(2) |
+--------------------+
| 1.4142135623730951 |
+--------------------+
SELECT SQRT(4);
+---------+
| SQRT(4) |
+---------+
| 2 |
+---------+