mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Update table.md
This commit is contained in:
parent
abeccff02e
commit
781980159c
@ -50,18 +50,15 @@ Creates a table with the same result as that of the [table function](../../../sq
|
|||||||
### From SELECT query {#from-select-query}
|
### From SELECT query {#from-select-query}
|
||||||
|
|
||||||
``` sql
|
``` sql
|
||||||
CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = engine AS SELECT ...
|
CREATE TABLE [IF NOT EXISTS] [db.]table_name[(name1 [type1], name2 [type2], ...)] ENGINE = engine AS SELECT ...
|
||||||
```
|
```
|
||||||
|
|
||||||
Creates a table with a structure like the result of the `SELECT` query, with the `engine` engine, and fills it with data from `SELECT`.
|
Creates a table with a structure like the result of the `SELECT` query, with the `engine` engine, and fills it with data from `SELECT`. Also you can explicitly specify columns description.
|
||||||
|
|
||||||
If the table already exists and `IF NOT EXISTS` is specified, the query won’t do anything.
|
If the table already exists and `IF NOT EXISTS` is specified, the query won’t do anything.
|
||||||
|
|
||||||
There can be other clauses after the `ENGINE` clause in the query. See detailed documentation on how to create tables in the descriptions of [table engines](../../../engines/table-engines/index.md#table_engines).
|
There can be other clauses after the `ENGINE` clause in the query. See detailed documentation on how to create tables in the descriptions of [table engines](../../../engines/table-engines/index.md#table_engines).
|
||||||
|
|
||||||
!!! warning "Warning"
|
|
||||||
The `SELECT` results must match the table description, otherwise an exception is thrown.
|
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
Query:
|
Query:
|
||||||
|
Loading…
Reference in New Issue
Block a user