# Reconcile MySQL Counts When Columns Can Be NULL

https://ferkesh.net/zh/knowledgebase/article/mysql-count-null-audit

In MySQL COUNT(*) counts rows in a result. COUNT(column) counts rows with a non-NULL value for that expression. Two dashboards can show different totals without disagreeing about which rows match a filter.

![Filtered result: Three rows; COUNT of column: Two dates; Report definition: Name what is counted.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-16.svg#mysql-count-null-audit)

## Compare a defined fixture

Imagine three synthetic orders. Two have shipped_at dates and one has NULL. With the same filter COUNT(*) is three and COUNT(shipped_at) is two. Check what a populated date actually represents before naming the metric.

## Check query shape

Use the same filters, joins and date range before comparing counts. A one-to-many join can multiply rows. A filter placed on the right-side table can change which unmatched rows appear. Verify expected group counts using a small read-only staging sample.

## Document the intended measure

Use plain labels such as eligible orders and orders with a recorded shipment date. Test empty and NULL cases. Use an approved read-only role in production and make reporting changes only against the agreed definition.

## Related Ferkesh Knowledge Base guides

- [How to Read MySQL EXPLAIN for a Slow SELECT](https://ferkesh.net/knowledgebase/article/mysql-explain-select-on-staging)
- [How to Audit Database Time Zones After a Website Move](https://ferkesh.net/knowledgebase/article/sql-timezone-migration-audit)

## Official references

- [MySQL 8.4 aggregate functions — Oracle](https://docs.oracle.com/cd/E17952_01/mysql-8.4-en/aggregate-functions.html)

Last reviewed November 27, 2026.
