You can use a nonrecursive WITH clause to define one or more common table expressions (CTEs) in derived table and view definitions. CTEs are also referred to as named queries.
Previously, when a nonrecursive WITH clause defined multiple CTEs, a CTE could only reference a subsequent CTE in the WITH clause. Now, a CTE can reference a preceding or subsequent CTE in the WITH clause.
CREATE VIEW statements and derived table definitions can include a nonrecursive WITH clause with backward and forward CTE references.
A CTE cannot indirectly reference itself, that is, circular references are not allowed.
- SQL DDL Syntax and Examples
- SQL DML