POWER

Returns the value of x to the power of y (xy).

POWER(x,2) is equivalent to SQUARE(x). See SQUARE.

Syntax

POWER( expr )

Arguments

Parameter Description
expr Numeric expression

Returns

returns the same type as the argument supplied.

Notes

  • If the value is NULL, the result is NULL.

Examples

On integers

numbers=> SELECT POWER(3,x) FROM (VALUES (1), (2), (3), (4), (5)) AS t(x);
power
-----
    3
    9
   27
   81
  243

On floating point

numbers=> SELECT POWER(3.0,x) FROM (VALUES (1), (2), (3), (4), (5)) AS t(x);
power
-----
  3.0
  9.0
 27.0
 81.0
243.0