Closed mbtaylor closed 3 years ago
Indeed, it makes sense to mention CTEs in this section.
I guess something like the following, just at the end of this section:
If supported by the implementation, table subqueries MAY be used for declaring named result set in the
WITH
clause of the main query:
WITH subsample AS (
SELECT alpha_source.id FROM alpha_source WHERE id < 10
)
SELECT
alpha_source.id
FROM
alpha_source INNER JOIN subsample USING(id)
WHERE
alpha_source.id >= 5
Should section 2.2.1 "Subqueries" mention
WITH
clauses (CTEs) alongsideWHERE
andFROM
clauses as another place where subqueries are permitted?