SQL 2023 · Aggregation and window functions

Group and total

Compute a value per group.

SELECT status, COUNT(*) AS n, SUM(total) AS revenue FROM orders GROUP BY status;

Official SQL 2023 documentation

More aggregation and window functions commands

All aggregation and window functions commands · SQL 2023 cheatsheet

Was this page helpful?