Collections
Datasets
Tools
CSV to SQL
JSON to SQL
Sign In
Name
Description
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.
Database
PostgreSQL
MySQL
MariaDB
Oracle
Cancel
Save
Use desktop for interactive SQL sandbox
Settings
Fork this book
Notes
SQL
MySQL - 8.0
Oracle - 21.3.0
PostgreSQL - 17
ERD
Run Code
Read-only book
Fork to Edit
Tip: Press
Alt
+
Enter
to run SQL
SQL Output
Clear
Getting Started
1
Switch to a SQL tab and select a database
2
Write or paste your SQL in the editor
3
Press
Alt
+
Enter
to run
Quick Templates
Show Tables
Basic SELECT
JOIN Example
Create Table
Tip:
Select text in the editor to run only that portion
Tracing Paths with Recursive CTEs
Updated 1/16/26, 12:29 PM
Notes
SQL
Alt+Enter to run