In MySQL, how to raise a number to the power of another number?

MySQLMySQLi Database

POWER() function is used to raise a number to the power of another number. POW() is the synonym of POWER() function. In these functions, the first arguments work as the base and the second argument works as the exponent. 

Syntax

POWER(M, N)  

Here, 

  • M is the number which is the base of exponentiation. 
  • N is the number which is the exponent of exponentiation.

Example

mysql> Select POWER(2,3),POW(2,3);
+------------+----------+
| POWER(2,3) | POW(2,3) |
+------------+----------+
|          8 |        8 |
+------------+----------+
1 row in set (0.00 sec)
raja
Published on 20-Feb-2018 22:33:51
Advertisements