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: )

596 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,564 reads

Blogs

Invest in Yourself Stop Making Excuses

By

Bob Pusateri (B|T) tweeted a quote image that really struck a chord with me...

Every Execution Plan Is An Estimated Plan

By

I consider myself to be the most responsible for making such a huge deal...

SQLSaturday Orlando Notes – Kahoot

By

The last two years we did Family Feud as part of our end of...

Read the latest Blogs

Forums

SQL Management studio 2014 express edition

By bokswager

Guys, Can I use SSMS 2014 Express edition to connect to a lower and...

unable access sql provider in powershell without running an invoke-sqlcmd first

By Steve T

I encountered a weird issue and hope that somebody may have a fix for...

Function to pad Bigint with leading zeros or other single characters

By Shane Clarke

Comments posted to this topic are about the item Function to pad Bigint with...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers