News for hackers. Stuff that matters.
Re:SQLite: Outlandish Recursive Query Examples by pawelduda on Sunday November 24, 2024 @07:04PM (#42231791)
It's unusual and not a commonly needed tool in SQL. I always need a quick refresher on how to write these after a longer break
Re:SQLite: Outlandish Recursive Query Examples by DemocracyFTW2 on Monday November 25, 2024 @04:18AM (#42234568)
Not commonly needed presumably only because we've grown up to understand that SQL is not a language where you can easily express rescursively hierarchical relationships, such as the in the go-to example where you have a table of employees with a 'reports-to' field. In classical SQL there was no way to write a simple query that will resolve 'who is reporting to who' recursively with an arbitrary depth. Recursive CTEs can do that.