#databases

2 posts
Development

The Query That Made Me Stop Writing Self-Joins

The query was four hundred lines long. It had three nested subqueries, two of which selected from the same table with slightly different date filters, and a self-join that existed purely so one row co...

2026.09.16 · 13 min read · views 749
The Query That Made Me Stop Writing Self-Joins
Development

SQL Window Functions, Explained Without the Headache

You have a table of sales, and your boss asks a deceptively simple question: "For each salesperson, show me their monthly total and how that compares to the month before." You know how to get the mont...

2026.07.03 · 16 min read · views 2,346
SQL Window Functions, Explained Without the Headache
AD