Order By Vs Group By

Опубликовано: 17 Февраль 2026
на канале: Coder Decoder
385
10

This is useful as it allows you to summarize information. For instance you can use aggregate functions such as SUM and AVERAGE to calculate values.

In this example

SELECT SalesOrderID,
SUM(OrderQty* UnitPrice) As TotalPrice
FROM Sales.SalesOrderDetail
GROUP BY SalesOrderID