Hacker News new | ask | show | jobs
by choppaface 2311 days ago
Do you have an example of where one might use WITH RECURSIVE?
1 comments

A classical example is graph reachability. You'd express reachability via WITH RECURSIVE stating that nodes are reachable if there is a path of arbitrary length between them. (Recursion is needed since a plain SQL query can only query for paths up to a fixed length).