what is common table expression in sql 1

what is common table expression in sql

CTE generates a temporary result that will further 
be used by select, update, delete.

Here is what the above code is Doing:
1. The WITH clause is used to define a temporary named result set,
also known as a common table expression (CTE).
2. The CTE is named as “cte” and it is defined as the result set of the
SELECT statement.
3. The CTE is used in the main query to select the data from the
“cte” table.

Similar Posts