The POW SQL Function in MySQL and MariaDB - Power of exponent |
|
| POW | Syntax: | POW(Number, Exponent) | Return value: | FLOAT | Synonyms: | POWER | Function type: | Numeric function | |
| | The POW() function returns the value of "Number" raised to the power of "Exponent".
If either argument is NULL, the function returns NULL. | SQL Examples for the POW function |
|
select pow(2,4);
select pow(2.1, 1.5);
select pow(4, 0);
select pow(4, -2);
select pow(null, 4);
select pow(4, null);
|
|
|
pow(2.1, 1.5) |
double(23) |
3.043189116699782 |
|
|
|
pow(4, -2) |
double(23) |
0.0625 |
|
|
pow(null, 4) |
double(23) |
NULL |
|
|
pow(4, null) |
double(23) |
NULL |
|
|
| The examples were created with the MyWAY SQL manager: | How to use the POW() function in MySQL and MariaDB databases | The POW() function in MySQL and MariaDB calculates the power of a given base raised to the specified exponent. The function is used when calculations with exponentiation have to be performed, for example compound interest calculations, growth rates or exponential models. The POW() function uses floating point arithmetic, so the precision of the result depends on the underlying data type. | | Further MySQL und MariaDB SQL Numeric functions | |
| | More information about the POW SQL function: and and |
|
|
|
|