Common Table Expressions (CTE)

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

2019-11-25 (first published: )

473 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

2019-11-12 (first published: )

1,402 reads

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.

2015-03-18

2,457 reads

Blogs

VMware & SQL Server 823-824 alerts

By

We’ve been tracking a weird state with SQL Server virtual machines on VMware and...

Daily Coping 18 May 2022

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Storage Field Day 23 – SIOS

By

I am thrilled to have been a part of this year’s Storage Field Day...

Read the latest Blogs

Forums

Search not working???

By jbalbo

Hi, We have a user that is not an administrator that says when they...

sql server enterprise edition or standard

By juliava

Hello, I was looking over the Edition specifications, and Standard is capped at 128...

Quick Question on 2019 to older version?

By oogibah

A client of ours is upgrading their database to SQL Server 2019. The edition...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers