Tagged “sql”
2 posts
Sessionization with SQL window functions
A stream of events isn't sessions until you decide where one visit ends and the next begins. You can do that in three window functions — no self-joins, no Python — and the whole thing hinges on the same frame-clause detail that trips people up on running totals.
|6 min readSQL window functions: a practical guide
Window functions are the single highest-leverage SQL feature for analytics work, and the frame clause is the part everyone skips — right up until their running total is silently wrong. Here's the whole thing, practically.
|5 min read