- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which one is better POW() or POWER() in MySQL?
Both pow() and power() are synonyms in MySQL. Following is the syntax −
select pow(yourValue1,yourValue2); OR select power(yourValue1,yourValue2);
Let us implement both the above syntaxes.
Using POW()
mysql> select POW(4,3);
This will produce the following output −
+----------+ | POW(4,3) | +----------+ | 64 | +----------+ 1 row in set (0.00 sec)
Using POWER()
mysql> select POWER(4,3);
This will produce the following output −
+------------+ | POWER(4,3) | +------------+ | 64 | +------------+ 1 row in set (0.00 sec)
Let us implement the above syntax in a table −
mysql> create table DemoTable ( a int, n int ); Query OK, 0 rows affected (0.51 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(10,3); Query OK, 1 row affected (0.18 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable;
This will produce the following output −
+------+------+ | a | n | +------+------+ | 10 | 3 | +------+------+ 1 row in set (0.00 sec)
Following is the query of POW() −
mysql> select POW(a,n) from DemoTable;
This will produce the following output −
+----------+ | POW(a,n) | +----------+ | 1000 | +----------+ 1 row in set (0.02 sec)
Following is the query of POWER() −
mysql> select POWER(a,n) from DemoTable;
This will produce the following output −
+------------+ | POWER(a,n) | +------------+ | 1000 | +------------+ 1 row in set (0.00 sec)
- Related Articles
- Is POW() better or POWER() in MySQL?
- Which one is better in MySQL - NULL or empty string?
- Which one is better to insert NULL or empty string in MySQL?
- Which one is better Build, Rebuild, or Clean in C#?
- Which is better - Hike or Whatsapp?
- Which is better: C or Python?
- Which is better: Python or C++?
- Which is better: Python or Node.js?
- Which one is better to use for a JavaScript link, “#” or “javascript:void(0)”?
- Which one is better in between pass by value or pass by reference in C++?
- Which is better PHP SOAP or NuSOAP?
- Canva or Adobe Spark: Which is better?
- Which is better: PHP or Python? Why?
- Which is better System.String or System.Text.StringBuilder classes in C#?
- Write a power (pow) function using C++

Advertisements