| | |
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.
| Functions | Description |
| max | We can find out maximum value from a field of mysql table by using max command |
| min | 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 |
| avg | 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 | 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. |
| |
| |
|
|
|
|
|