Answer the question
In order to leave comments, you need to log in
What is the meaning of GROUP BY?
When using SUM, it is always required to use GROUP BY, moreover, with the same fields as in SELECT. What is the meaning of this?
Answer the question
In order to leave comments, you need to log in
Sum is an aggregating function.
There are also other functions: COUNT is valid.
Group by groups rows together according to some criteria.
Let's say we have a table
id name
We want to count the number of entities with the same names.
we do Group by name, with the aggregating function COUNT.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question