Loadingโฆ
Loadingโฆ
Before running anything expensive, destructive, or going into a report.
Review this query for correctness. I have not run it yet. Do not tell me it looks good. Check in this order: 1. **Grain**: what is one output row? Does any join multiply rows before aggregation, inflating the sums? 2. **Filters**: does any WHERE condition on an outer-joined table silently convert it to an inner join? 3. **NULLs**: in join keys, in NOT IN lists, in comparisons, inside aggregates. 4. **Dates**: inclusive or exclusive boundaries, timezone, whether BETWEEN is dropping the last day. 5. **Aggregates**: COUNT(*) against COUNT(column), averages of averages, SUM over a duplicated row set. 6. **Destructive statements**: any UPDATE or DELETE without the WHERE clause I intended, or whose WHERE matches more than I think. Give a verdict: safe to run, run with caveats, or do not run. Then give me one cheap query that verifies your main concern before I run the real one. 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