SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Math functions in MySQL

We can use various mathematical functions available in MySQL queries to handle our numeric data in a table. We can update our data with new data or use them in our script as per our requirements. We will discuss some of the important math functions used frequently in queries for MySQL table.

Maximum value in a field

We can find out maximum value from a field of mysql table by using max command

Minimum value

Minimum value among records can be found out by using min sql command

sum

Our query can return sum of numeric data present in a record

Average

We can get the average value of a range of data by using avg function.

floor

Math floor function to get highest integer value.

ceil

Math ceil function to get lowest integer value.

count

Counting the number of records in a table with conditions

Mod

Getting the reminder of a division and using in our Query

Second highest number

WE can display first and second highest number present in table by using limit and order by commands

Data format

Getting the formatted output from mysql table by using format query.


Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked


Join Our Email List
Email:  
For Email Newsletters you can trust
SQL Tutorial List
MySQL Math
SQL Commands
SQL Sections
Date & Time
Join Table
String
Math