What is the purpose of the GROUP BY
clause in SQL?
adminnewd Changed status to publish September 19, 2024
The GROUP BY
clause is used to arrange identical data into groups. It is often used in conjunction with aggregate functions like COUNT()
, SUM()
, AVG()
, MAX()
, and MIN()
to perform operations on each group of data. For example, if you want to calculate the total sales for each salesperson, you would use GROUP BY
to group the sales data by each sale
anonymous Answered question September 19, 2024