• Remember, while it has the word "table" in the definition of Common Table Expression, a CTE is nothing but a query. It's not a table. Comparing it to a temp table means you might be under that impression.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning