Skip to content
Advertisement

“recursive” query in postgresql

this is my current query :

this is an example of the table on which i make my query and the current result i get:

this is not the result i want to get. what i would like is the request to be “recursive” so that the 6th location gets the geolocation of the “root parent” (in this case location aaaa). so my expected result is :

i tried to use the “cte method” but i can’t get the result i want…

anyone has an idea?

best regards and have a great day

ps : careful, geolocation is a string

Advertisement

Answer


Results:


User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement