Back to Clickhouse

merge

docs/en/sql-reference/table-functions/merge.md

26.4.1.1-new1.7 KB
Original Source

merge Table Function

Creates a temporary Merge table. The table schema is derived from underlying tables by using a union of their columns and by deriving common types. The same virtual columns are available as for the Merge table engine.

Syntax {#syntax}

sql
merge(['db_name',] 'tables_regexp')

Arguments {#arguments}

ArgumentDescription
db_namePossible values (optional, default is currentDatabase()):
- database name,
- constant expression that returns a string with a database name, for example, `currentDatabase()`,
- `REGEXP(expression)`, where `expression` is a regular expression to match the DB names. |

| tables_regexp | A regular expression to match the table names in the specified DB or DBs. |