Loadingโฆ
Loadingโฆ
Your totals are suspiciously round multiples of what they should be.
My results are inflated and I think a join is multiplying rows. 1. For each join in the query below, state the expected relationship: one-to-one, one-to-many, or many-to-many. Say which side can have duplicates on the join key. 2. Identify every join where the key is not unique on at least one side. These are the suspects. 3. Point out any join condition that is missing a component of a composite key, or that joins on a column which is only unique per tenant, per day, or per version. 4. Look for a missing filter on a slowly-changing or versioned table where multiple historical rows match. Then give me a diagnostic query for each suspect: group by the join key, count, and return only counts greater than one. Finally, give the corrected query, and say whether to fix it by deduplicating, by aggregating before joining, or by tightening the key. Query:
Correctness checks. Catching the join that duplicates rows, the NULL that drops them, and the GROUP BY that lies.
Promptory saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.
Add to your browser โ free