Berserk Docs
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

NameDescription
tablesTwo or more table names or table expressions

Syntax

union kind=inner T1, T2, ...

Combine rows, keeping only columns common to all tables

Parameters

NameDescription
tablesTwo or more table names or table expressions

Syntax

union withsource=col T1, T2, ...

Combine rows with a column identifying the source table

Parameters

NameDescription
colName for the source table column
tablesTwo 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)
Bjornsword
Haraldspear
Ragnaraxe
Rolloaxe

On this page