Tabular OperatorsAggregate Operators
distinct
Returns a table with the distinct combination of the provided columns of the input table.
Syntax
distinct column, ...Return distinct values of the specified columns
Parameters
| Name | Description |
|---|---|
| column | Column name or expression |
Syntax
distinct *Return all distinct rows
Examples
Example 1
datatable(warrior:string, weapon:string)[
"Ragnar", "axe",
"Bjorn", "sword",
"Lagertha", "spear",
"Ivar", "axe",
"Floki", "axe",
"Harald", "sword"
]
| distinct weapon| weapon (string) |
|---|
| axe |
| spear |
| sword |
Example 2
datatable(warrior:string, clan:string)[
"Ragnar", "Lothbrok",
"Bjorn", "Lothbrok",
"Harald", "Fairhair",
"Ivar", "Lothbrok"
]
| distinct clan| clan (string) |
|---|
| Fairhair |
| Lothbrok |
Example 3
datatable(warrior:string, weapon:string)[
"Ragnar", "axe",
"Bjorn", "sword",
"Ivar", "axe",
"Ragnar", "axe"
]
| distinct warrior, weapon| warrior (string) | weapon (string) |
|---|---|
| Bjorn | sword |
| Ivar | axe |
| Ragnar | axe |