dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Jul 19, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Use MySQL for Calculations

At times, when you want to compute the result of a mathematical formula, you can use MySQL to do the task. It is a great tool for this. Here are a few examples:

Query:

SELECT PI();

Output:

+------------+
| PI()       |
+------------+
| 3.141593   |
+------------+

Query:

SELECT PI() * 7;

Output:

+------------+
| PI() * 7   |
+------------+
| 21.991149  |
+------------+

Query:

SELECT 399*12/4, 6*12;

Output:

+------------+------------+
| 399*12/4   | 6*12       |
+------------+------------+
| 1197.0000  | 72         |
+------------+------------+
Sridhar MS
 
Thanks for your registration, follow us on our social networks to keep up-to-date