A stakeholder requests “unique customers” across a month for a dashboard where each customer can have multiple orders per day. Which approach most reliably prevents double-counting?

Answer

Use COUNT(DISTINCT customer_id) after filtering orders to the target monthly date range

Explanation

Filtering to the target month before applying COUNT(DISTINCT) ensures uniqueness is evaluated over the correct period.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list