What Is CTE in SQL?

Forums SQLWhat Is CTE in SQL?
Staff asked 2 months ago

Answers (1)

Add Answer
Staff answered 1 month ago

CTE (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 )

 

 

Subscribe

Select Categories