CTE

SQLServerCentral Article

Navigating Trees With CTE

  • Article

Introduction This article shows how common table expressions (CTE) in SQL Server are naturally suited for navigating trees, such as finding its longest path, or diameter. Recall that a tree is an undirected graph where unique paths exist between any two nodes (i.e. vertices). Any node may be selected as its top node, with its […]

(5)

You rated this post out of 5. Change rating

2021-04-19

8,140 reads

Blogs

Walking Through a Planned Failover: SQL Server Availability Groups on Kubernetes

By

When building the sql-on-k8s-operator, I wanted to make sure it could handle both planned...

Reading SQL Server File Headers with DBCC FILEHEADER

By

I’ve been doing a deep dive into SQL Server on-disk structures lately, and one...

T-SQL Tuesday #197 – An impactful session or two from a conference – RECAP

By

Thanks to everyone who joined the blog party this month. I noticed three themes...

Read the latest Blogs

Forums

What's new in R 4.6

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What's new in R 4.6

Interesting Changes in R

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Interesting Changes in R, which...

PostgreSQL String Functions Part 1

By Shivayan Mukherjee

Comments posted to this topic are about the item PostgreSQL String Functions Part 1

Visit the forum

Question of the Day

Identities and Sequences V

When thinking about the identity property and sequence objects, which of these can generate values before an insert statement is executed?

See possible answers