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.
1 SQL 1 Notes
Switch to a SQL tab and press Alt+Enter to run queries