MySQL Group By Clause

The GROUP BY statement is used to group the result set returned by SELECT statement by one or more columns.We can use GROUP BY to group values of a column we can perform any calculations on that column. COUNT, SUM, AVG etc. function can be applied on the grouped column.

Consider below “emp_info” table

empID empName sale
1 Mark 1000
2 Max 1000
3 Mark 1000
4 Mark 1000
5 John 1000


empName sale
Mark 3000
Max 1000
John 1000