Answer the question
In order to leave comments, you need to log in
What query is needed in the MySQL database to select all children together with their parents with the Nested Sets structure?
Hello, I will have the following structure:
Regions of the country: 24 pcs. (parents);
Districts, cities of regional and district significance will come from each region, and settlements (villages, urban-type settlements) will come from them.
I want to make a selection from the database and sort in such a way that there would be an output like c. Raevka, Sinelnikovsky district, Dnepropetrovsk region.
Answer the question
In order to leave comments, you need to log in
don't know what you use in laravel for nested sets but here is getting children with all parents sqlfiddle.com/#!9/4997d54/1
For such a structure, separate tables for each entity are more suitable: region, district, settlement.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question