Common Table Expressions

suggest change

Syntax

SELECT …

)

SELECT … FROM QueryName …;

SELECT …

UNION [ALL]

SELECT … FROM QueryName …

)

SELECT … FROM QueryName …;

Remarks

Official documentation: WITH clause

A Common Table Expression is a temporary result set, and it can be result of complex sub query. It is defined by using WITH clause. CTE improves readability and it is created in memory rather than TempDB database where Temp Table and Table variable is created.

Key concepts of Common Table Expressions:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Common Table Expressions:
*Common Table Expressions

Table Of Contents