Tabular OperatorsOther Operators
union
Combines rows from two or more tables into a single result set.
Syntax
union T1, T2, ...Combine rows from multiple tables (outer join of schemas)
Parameters
| Name | Description |
|---|---|
| tables | Two or more table names or table expressions |
Syntax
union kind=inner T1, T2, ...Combine rows, keeping only columns common to all tables
Parameters
| Name | Description |
|---|---|
| tables | Two or more table names or table expressions |
Syntax
union withsource=col T1, T2, ...Combine rows with a column identifying the source table
Parameters
| Name | Description |
|---|---|
| col | Name for the source table column |
| tables | Two or more table names or table expressions |
Examples
Example 1 — Combine two warrior rosters
union (datatable(warrior:string, weapon:string)[
"Ragnar", "axe",
"Bjorn", "sword"
]), (datatable(warrior:string, weapon:string)[
"Harald", "spear",
"Rollo", "axe"
])| warrior (string) | weapon (string) |
|---|---|
| Bjorn | sword |
| Harald | spear |
| Ragnar | axe |
| Rollo | axe |