id name parent1 aaa null
2 bbb 1
3 ccc 1
4 ddd 3
is it possible to select reucursivly?
For example for id 4 I would like a result like this:
aaa-ccc-ddd
For id 3 like this:
aaa-ccc
not in ansi sql, as far as i know -- maybe some recent version of standard sql has introduced recursion, but that matters little if no actual databases out in the real world support it
oracle is an exception, you can do it in oracle using START WITH and CONNECT BY syntax
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.