Common Table Expressions (CTE)
A CTE is a temporary result set defined within the execution scope of a single query. It improves readability and supports recursion.
Syntax
WITH CTEName AS (
SELECT ...
)
SELECT * FROM CTEName;Temporary named result sets that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement.