What Is CTE in SQL?
Answers (1)
Add AnswerCTE (Common table expression) is introduced in SQL server 2005. A CTE is a temporary result set, that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement, which will immediately follow the CTE.
CTE can be defined using WITH Keyword.
Syntax:
WITH cte_name (Column1, Column2, ..) AS ( CTE_query )