PostgreSQL - Common Table Expressions
Given the table
What will the following query return?
edges(source INT, target INT) with data:(1, 2), (2, 3), (3, 4), (2, 5)What will the following query return?
WITH RECURSIVE path AS (SELECT source, target FROM edges WHERE source = 1 UNION ALL SELECT e.source, e.target FROM edges e JOIN path p ON e.source = p.target) SELECT * FROM path ORDER BY source, target;
