v.20.9New Feature

Added table function view for subqueries in ClickHouse

Added table function view which turns a subquery into a table object. This helps passing queries around. For instance, it can be used in remote/cluster table functions. #12567 (Amos Bird).
Added the view table function that converts a subquery into a table object, enabling easier query reuse and composition.

Why it matters

The view function addresses the need to pass queries as table objects, simplifying the use of subqueries within other table functions such as remote or cluster. This enhances flexibility and modularity in query construction.

How to use it

Use the view function by wrapping a subquery inside it. For example:

SELECT * FROM view('SELECT * FROM my_table WHERE condition')

This allows the subquery to be treated as a table object and passed to other table functions like remote or cluster.