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


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)

Updated on: 20-Jun-2020

197 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements