SQL SQRT: Returns the Square Root a Number

The SQL SQRT function returns the square root of a number.

Syntax

SQRT(number | expression)Code language: SQL (Structured Query Language) (sql)

Argument

number | expression
is a number or expression that evaluates to a number. The SQRT function only accepts a positive number. If you pass a negative number to the function, it will issue an error.

Return type

The SQRT function a float number with the precision that depends on each RDBMS implementation.

Examples

The following statement returns the exponential value of the 10.

SELECT SQLRT(100);Code language: SQL (Structured Query Language) (sql)
 sqrt
------
   10
(1 row)Code language: SQL (Structured Query Language) (sql)
Was this tutorial helpful ?