LEAD defaults handle a missing following row. Keep that boundary separate from a present row containing NULL and choose replacement policy explicitly.
SUM ROWS Versus RANGE: Ties Change a Running Total
SUM ROWS versus RANGE defines different running positions. Keep tie-breaking and peer grouping explicit when comparing the resulting totals.
CASE Sort Priority: Put Business Order Before Alphabetical Order
CASE sort priority makes the queue policy explicit. Map known statuses to numeric ranks and keep missing or unfamiliar labels visible. Finish tied ranks with a unique key.
LAG IGNORE NULLS: Read the Previous Available Value
LAG IGNORE NULLS reads the previous non-NULL value within an ordered partition. These examples distinguish skipped rows, missing previous values and the supplied default.
RANK vs DENSE_RANK: Keep Poll Ties at the Cutoff
RANK vs DENSE_RANK gives tied vote totals different cutoff behavior. Keep display ordering separate from the tie criterion and rank each poll independently.
Breaking Ties Deterministically: Why ORDER BY Needs a Tie-Breaker
Tied scores can come back in any order, which breaks paging. Here is the one column that fixes it.
Running Start Times: Build an Agenda With SQL
Running start times depend on the durations that precede each activity. Use ordered window sums while retaining full dates and explicit end boundaries.







