In this PostgreSQL post explains how to use the PostgreSQL sqrt function with syntax and examples.
The PostgreSQL sqrt function returns the square root of a number.
The syntax for the sqrt function in PostgreSQL is:
sqrt( number )
The positive number to take the square root of.
The sqrt function can be used in the following versions of PostgreSQL:
Let's look at some PostgreSQL sqrt function examples and explore how to use the sqrt function in PostgreSQL.
For example:
postgres=# SELECT sqrt(25);
sqrt
------
5
(1 row)
postgres=# SELECT sqrt(26);
sqrt
------------------
5.09901951359278
(1 row)
postgres=# SELECT sqrt(0);
sqrt
------
0
(1 row)