Count unique entries in a column.
Section: Advanced Aggregation
Count distinct values
sql
sql
SELECT COUNT(DISTINCT customer_id) AS unique_customers
FROM orders;Explanation
Distinct counts are common in analytics and business reporting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Advanced Aggregation