Use desktop for interactive SQL sandbox
Tip: Press Alt+Enter to run SQL

SQL Output

Tracing Paths with Recursive CTEs
Public
Learn to reconstruct complete paths from individual point-to-point records using recursive CTEs, one of SQL's most powerful features for connected data. This tutorial demonstrates how to trace end-to-end journeys through linked records, from package delivery routes to network packet paths. Originally developed for analyzing IPFIX network flow data, this pattern applies universally to organizational hierarchies, manufacturing bill-of-materials, supply chains, file systems, and any scenario where you need to follow parent-child relationships. Includes complete working examples you can run immediately in PostgreSQL or MySQL at SQLBook.io.
jrz1977
PostgreSQL
Created Jan 12, 2026
Updated Jan 16, 2026
1Notes Notes
2SQL SQL
1 SQL 1 Notes
Switch to a SQL tab and press Alt+Enter to run queries
Tracing Paths with Recursive CTEs Updated 1/16/26, 12:29 PM
Notes SQL
Alt+Enter to run