WITH
Description
The WITH
clause, also known as the subquery factoring clause, is a feature that allows to define temporary named result sets based on subqueries. These named result sets can then be referenced within the main body of your SQL statement, improving readability, modularity, and potentially performance. The WITH
clause is also known as Common Table Expressions (CTEs).
The WITH
clause is supported by many RDBMS such as MySQL, SQL Server, Oracle etc.
Syntax:
Example:
Last updated