v.20.10New Feature
Support for Named Subqueries with WITH Syntax
Now we support WITH <identifier> AS (subquery) ... to introduce named subqueries in the query context. This closes #2416. This closes #4967. #14771 (Amos Bird).Why it matters
This feature introduces the ability to declare named subqueries, improving query readability and reusability by allowing users to reference complex subqueries multiple times without repeating them. It enhances query structuring and supports better organization of SQL code.How to use it
Users can define named subqueries using theWITH clause followed by an identifier and a subquery in parentheses. For example:WITH subquery_name AS (
SELECT ...
)
SELECT ... FROM subquery_nameThis named subquery can then be used within the main query as a table or source.