- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
- Window
- System
On this page
count_distinct
Counts distinct non-NULL input values exactly.
Syntax
count_distinct( <expr> )
Returns
Returns int.
Examples
VALUES ('a'), ('b'), ('a'), ('c')
AGGREGATE count_distinct($0);