The GROUP BY used to group the related rows together based on the column value(column on which group by is applied).
After GROUP BY, WHERE command is not used to put restriction for doing this HAVING clause is used.
It is used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result set by one or more columns.
Syntax
SELECT column1,column2 FROM tablename WHERE condition GROUP BY column1
Copyright ©2022 coderraj.com. All Rights Reserved.