MySQL MAX Aggregate Function is to find the maximum value of total records (or rows) selected by the SELECT Statement. For example, If you want to find the top-selling product in your Store, then you can use this Maximum function. The basic syntax of the MAX function to find the maximum is
SELECT MAX ([Column_Name]) FROM [Source]
How to find Maximum with an example. For this MAX function demo, We are going to use the below-shown data.
MySQL MAX Function Example
The Max function returns the maximum value present in the specified column. For example, The following query returns the Maximum or Highest Yearly Income value from the customer details table. Also, read about the MySQL MIN function.
SELECT MAX(Yearly_Income) AS `Maximum Income` FROM customerdetails;

MAX Group By Example
In general, we use this MySQL Aggregate method to check for top-performing products belonging to a particular category, color, etc.
In this situation, we can use MySQL GROUP BY Clause to group the products by color or category. Next, we use this MySQL MAX Function to find the highest value in each group by.
USE company;
SELECT Education,
MAX(Yearly_Income)
FROM customerdetails
GROUP BY Education;
The above Maximum query groups the Customers by their Education and finds the highest Income in each category.
TIP: To find the total and the average, please refer to the MySQL SUM and MySQL AVG functions.

You can use the MySQL DISTINCT Keyword along with this to remove the Duplicates. But, the MySQL SELECT Statement gives the same result as the above (without using the MySQL DISTINCT keyword).