SQL WHERE vs HAVING: Filter Rows before You Filter Groups
WHERE and HAVING both filter a SQL result, but they answer different questions. WHERE chooses input rows. HAVING filters groups after aggregation.…
A finished report needs more than readable charts. Before sharing it with a team in Malta, check whether its rows and totals mean what people expect. You can start with four small checks even before building a larger quality process.
Write a sentence such as “one row per completed order”. Check that a row really represents that unit. If a single order appears on several lines because it contains several items, a row count is not automatically an order count.
Identify which fields must be present for this report to be useful. For a delivery report, that might include an order reference and a completion date. Count missing values and inspect examples. Decide with the report owner whether to exclude them, show them separately or fix the source.
If the intended key is unique, look for repeated values. Do not delete them immediately. Two rows might be a real revision history or an accidental repeated import. The correct response depends on why the rows exist.
Take five invented orders with values of €10, €20, €30, €40 and €50. The expected total is €150. Check that the report keeps that total after filters and joins. Then repeat with an approved sample from the real source, following the team’s access rules.
These checks are a starting worksheet, not proof that every possible error has been removed. They give the next reader a clear account of what you actually verified.
Browse current technology vacancies with Huwell Consultancy and ask us about the responsibilities that matter to you.
Explore opportunitiesWHERE and HAVING both filter a SQL result, but they answer different questions. WHERE chooses input rows. HAVING filters groups after aggregation.…
Two reports can disagree about “yesterday” even when they use the same events. One may use UTC dates while the other uses…
A report total can become wrong even when the SQL runs without an error. One common cause is joining data at different…