Questions tagged [recursive]
Using recursion to solve database problems.
253
questions
2
votes
1
answer
157
views
How do I query a table with many trees of data, for one tree?
I have a the NAICS schema loaded and all is working well. However I'm confused as how I'd query it in Postgrseql?
The table looks something like this,
=========NAICS_2012=========
naics | ...
8
votes
1
answer
6k
views
Recursive CTE performance
Need help with recursive CTE performance. Below CTE is running very slow as it is trying to pull heirarchical
data recusively. Table is big with every root id having upto 3 recursive itemid. There ...
33
votes
2
answers
12k
views
Using EXCEPT in a recursive common table expression
Why does the following query return infinite rows? I would have expected the EXCEPT clause to terminate the recursion..
with cte as (
select *
from (
values(1),(2),(3),(4),(5)
) ...