Problem Statement
How do GROUP BY aggregations differ from window aggregations?
Explanation
GROUP BY returns one row per group and removes detail. Window aggregates compute per-row metrics across related rows, so the original detail is preserved.
This allows you to display both row-level attributes and group-level statistics in one result.
Code Solution
SolutionRead Only
SELECT order_id, amount,
SUM(amount) OVER (PARTITION BY customer_id) AS cust_total
FROM orders;