distinct_values
List distinct values of a database column with occurrence counts, ordered by frequency. Identify categories, enums, and cardinality for data exploration.
Instructions
Get the distinct values of a column with their frequencies, most common first.
Useful for understanding enums, categories and cardinality.
Args: table: Table name. column: Column name. where: Optional WHERE clause body without the WHERE keyword. limit: Max distinct values to return (default 100). schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| table | Yes | ||
| where | No | ||
| column | Yes | ||
| schema | No | ||
| database | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |