This gist provides practical examples of SQL window functions to enhance your data analysis skills. Through these examples, you'll learn how to use various window functions to perform complex calculations like ranking, running totals, moving averages, and more.
SELECT id, salesperson, amount,
ROW_NUMBER() OVER(ORDER BY amount DESC) AS row_num
FROM sales;