Your JOIN Is Correct. Your Data Grain Isn’t.
My Table Has 3,200 Accounts. Why Did This JOIN Return 7,841 Rows?

A SaaS account report should contain 3,200 accounts.
You add support-ticket data.
Now it contains 7,841 rows.
The JOIN is valid. The rows are not random.
The problem is grain.
Suppose these two tables have different grains:
Accounts
- One row per account
SupportTickets
- One row per support ticket
Now imagine this data:
Account 201 | Alpine | MRR 8,000 | 2 open tickets
Account 202 | Meridian | MRR 8,000 | 1 open ticket
Account 203 | Vertex | MRR 5,000 | 0 open tickets
The business wants one row per account.
But this query joins an account to every matching open ticket:
Keep Reading
Get free access to the full article
Join data professionals reading weekly SQL tips, career guides, and interview prep — completely free.
No credit card. No spam. Unsubscribe anytime.