Introduced in SQL Server 2005 , a Common Table Expressions (CTE) is a "temporary result set" that exists only within the scope of a single SQL statement. It allows access to functionality within that single SQL statement that was previously only available through use of functions, temporary tables, and cursors.
[Read more...]