I am looking for examples of why you would use a recursive CTE, but the dozens of examples I have found in my web searching basically reduce to two:
- Generating a sequence
- Iterating through an employee hierarchy
I did find one example where a recursive CTE is used to split a string by commas, which is by far the most interesting (db<>fiddles: SQL Server, Postgres).
Are there examples of recursive CTEs which are not basically one of the above?