What is the difference between CTE and temp table? Please explain.Devbrat Tripathi
Local Temporary Tables:
1. Prefixed with a single pound sign (#).
2. Local temporary tables are visible to that session of SQL Server which has created it.
3. Local temporary tables are automatically dropped, when the session that created the temporary tables is closed.
CTE - A Common Table Expression, or CTE is a temporary named result set, derived from a simple query and defined within the execution scope of a