MySQL: POW Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL POW Function

In this guide, we will explain how to use the MySQL POW function with syntax and examples.

Description

The MySQL POW function returns m raised to the nth power.

Syntax

The syntax for the POW function is:

POW( 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

  • The POWER function is a synonym for the POW function.

Applies To

The POW function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some POW function examples and explore how to use the POW function.

For example:

mysql> SELECT POW(5, 2);
Result: 25

mysql> SELECT POW(5, -2);
Result: 0.04

mysql> SELECT POW(5.5, 3);
Result: 166.375

mysql> SELECT POW(0, 4);
Result: 0

mysql> SELECT POW(4, 0);
Result: 1

Next Topic : Click Here

This Post Has One Comment

Leave a Reply