Skip to main content
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.

Examples

Input table:
Query
Response
You can use the view function as a parameter of the remote and cluster table functions:
Query
Query
Last modified on July 2, 2026