Skip to main content
Skip to main content

view

Turns a subquery into a table. The function implements views (see CREATE VIEW). The resulting table does not store data, but only stores the specified SELECT query. When reading from the table, ClickHouse executes the query and deletes all unnecessary columns from the result.

Syntax

Arguments

  • subquerySELECT query.

Returned value

  • A table.

Example

Input table:

Query:

Result:

You can use the view function as a parameter of the remote and cluster table functions:

See Also