This website uses cookies to ensure you get the best experience.
Learn more.
Orders contain tenant_id and order_id; order_id is unique only within a tenant. Lines contain the same keys. Joining on order_id alone doubles some totals. What is the best correction?
Published
- Replace the INNER JOIN with a LEFT JOIN on order_id alone
- Add DISTINCT to the final amount column
- Join on both tenant_id and order_id before aggregating
- Increase the SQL warehouse size before rerunning
Comments — 0
Sign in to comment