Common Table Expressions (CTE)

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 3: Understanding Common Table Expressions (CTEs)

  • Stairway Step

A CTE is a temporary result set defined by a simple query, and is used within the execution scope of a single INSERT, UPDATE, DELETE, or SELECT statement. In this article we will explore how to define and use CTE's.

2018-03-21 (first published: )

396 reads

CTEs and Trees

  • Article

Some new interresting points about trees and CTE in SQL Server : transforming a tree from auto reference to interval model (nested sets), calculating levels in interval model, creating a view of auto ref from an interval model, hierarchical numbering of items, and more. This article includes more examples based on his previous work.

4.11 (9)

2007-12-26

5,562 reads

Blogs

#DPS10 – preconfs

By

I have delivered a preconf on the biggest conference in Asia. The preconf was...

A Memory-Optimized Roundup – T-SQL Tuesday #117

By

The summary from my fourth T-SQL Tuesday hosting for #117. This time I was...

How do you debug your spark-dotnet app in visual studio?

By

When you run an application using spark-dotnet, to launch the application you need to...

Read the latest Blogs

Forums

Export to CSV

By Jenny77

Hi,   i am trying to export a table into csv, and it should...

CHECKDB

By VastSQL

My user database drive have about 100GB free space now and the database is...

Sql 2014 sp3 - extra stats created

By sqlguy7777

Has anyone seen Sp3 creating extra unexpected stats on tables after or during application...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers