What is the purpose of the GROUP BY clause in an SQL query?

  • It is used to aggregate data based on specified columns, grouping the results.
  • It is used to filter records based on a specified condition.
  • It is used to join multiple tables in a query.
  • It is used to sort records in ascending or descending order.
The GROUP BY clause is used to aggregate data based on specified columns. It groups the results and allows for the application of aggregate functions like COUNT, SUM, AVG, etc., on each group separately.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *