Loading topic
SELECT, WHERE and ORDER BY, use GROUP BY with SUM and COUNT, and read a simple common table expression (CTE). The examples use a sales table and run on PostgreSQL, MySQL 8+, SQL Server, SQLite 3.25+ or Oracle.1 min readsales table with id, region, salesperson, sale_date and amount columns. You need a database that supports window functions2 min readOVER, PARTITION BY, and ORDER BY inside a window. It also assumes your database supports frame clauses, such as PostgreSQL, MySQL 8+, SQL Server, SQLite 3.25+, or Oracle.2 min read