Answer the question
In order to leave comments, you need to log in
How to write a recursion on children?
A simple example. There is such a hierarchy: region, city, regions.
The table looks like this:
Google Tab
I want to filter by State and Region. respectively in the table more than 50000 records. For a faster selection, I decided to assign all cities and regions to their regions.
code_level is the id of the hierarchy 1 - region, 2 - cities, 3 - regions, respectively.
1) I don’t know how to write a recursive function correctly to go to the very regions and visit the regions for cities and regions.
Working in Symfony2 + postgreSQL Just in case someone knows how to do this via Php.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question