Updated on 2026-11-06 GMT+08:00

pow

The pow function is used to calculate a raised to the power of p.

Syntax

pow(DOUBLE a, DOUBLE p), 
power(DOUBLE a, DOUBLE p)

Parameters

Parameter

Mandatory

Type

Description

a

Yes

DOUBLE, BIGINT, DECIMAL, or STRING

The format of parameter a includes floating-point format, integer format, and string format. If parameter a is not of type DOUBLE, it is implicitly converted to DOUBLE type before evaluation.

p

Yes

DOUBLE, BIGINT, DECIMAL, or STRING

The format of parameter p includes floating-point format, integer format, and string format. If parameter p is not of type DOUBLE, it is implicitly converted to DOUBLE type before evaluation.

Return Values

Returns a value of type DOUBLE.

If a or p is NULL, NULL is returned.

Example Code

Returns 16.

select pow(2, 4); 

Returns NULL.

select pow(2, null); 

Returns 17.429460393524256.

select pow(2, 4.123456);