SQL FOR BUSINESS ANALYSTS · REFERENCE CARD

Window functions in depth: frames, lag and lead, and top N per group

Go past ranking. Learn what a frame of rows is, how to compare a row with the one before it, and how to keep the top few rows in each group.

Derived from Window functions in depth: frames, lag and lead, and top N per group. Every claim on this card is sourced on that page. All business analysis reference cards.