Skip to main content
Skip to main content

view Table Function

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

Try ClickHouse Cloud for FREE

Separation of storage and compute, automatic scaling, built-in SQL console, and lots more. $300 in free credits when signing up.

Try it for Free