ProAnswers.org

What is GROUP BY?

What is GROUP BY?

1 Like

The GROUP BY keywords have been added to SQL because aggregate functions (like SUM) return the aggregate of all column values every time they are called. Without the GROUP BY functionality, finding the sum for each individual group of column values was not possible.

The corresponding SQL syntax is,

SELECT "column_name1", SUM("column_name2") FROM "table_name" GROUP BY "column_name1";