According to w3schools group by needs an aggregate_function(column_name).
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
What it will happen if you commit this aggregate_function?
Thanks
If you are looking for best practice, do not use
GROUP BYunless you are using an aggregate function. MySQL is unique in that it allows you to specify additional columns without using aggregates. This is not found in other DBMS’s.The other effect that
GROUP BYhas is it’s sorting property.If you do not include any aggregate functions, it will most likely show the
DISTINCTvalues of the grouped column.