The GROUP BY clause is used in a SELECT statement to group rows with similar values into summary rows. It is usually used in conjunction with aggregate functions such as SUM, AVG, MAX, MIN, etc.

Example:

SELECT Country, SUM(TotalSales)
FROM Orders
GROUP BY Country;

This query would return the total sales for each country.

Leave a Reply

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