totn MariaDB Functions

MariaDB: POWER Function

This MariaDB tutorial explains how to use the MariaDB POWER function with syntax and examples.

Description

The MariaDB POWER function returns m raised to the nth power.

Syntax

The syntax for the MariaDB POWER function is:

POWER( m, n )

Parameters or Arguments

m
Numeric value. It is the base used in the calculation.
n
Numeric value. It is the exponent used in the calculation.

Note

Applies To

The POWER function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB POWER function examples and explore how to use the POWER function in MariaDB.

For example:

SELECT POWER(7, 2);
Result: 49

SELECT POWER(7, -2);
Result: 0.02040816326530612

SELECT POWER(2.5, 6);
Result: 244.140625

SELECT POWER(0, 5);
Result: 0

SELECT POWER(5, 0);
Result: 1