What is "cte"
One Common Table Expression (CTE) can be seen as a result set which is defined in the scope of execution of a single instruction SELECT, INSERT, UPDATE, DELETE, ou CREATE VIEW
.
One CTE is very similar to a derived table that is not stored as an object and exists only during the execution of the query. Different from a derived table a CTE can be self-referenced and can be referenced several times in the same query.