Subject | Re: Self-referencing table SQL question |
---|---|
Author | Scott Moon |
Post date | 2006-06-05T20:10:33Z |
--- In firebird-support@yahoogroups.com, Sam Hunt <shunt@...> wrote:
Given his sample data:
ID ParentID Name
1 <null> World
2 1 Europe
3 2 Sweden
4 2 Germany
5 3 Stockholm
6 3 Gothenburg
7 4 Berlin
ID 5 = Stockholm with Parent ID = 3
ID 3 = Sweden with Parent ID = 2
ID 2 = Europe with Parent ID = 1
ID 1 = World with no parent
He's looking for something similar to Oracle's "Connect By" clause to
define hierachical data, but I don't know if Firebird has an
equivalent structure.
Scott
>He's using a parent-child hierarchy.
> I don't see the correlation between your data and your question.
> You only have one item ID=5.
> Sam D
>
Given his sample data:
ID ParentID Name
1 <null> World
2 1 Europe
3 2 Sweden
4 2 Germany
5 3 Stockholm
6 3 Gothenburg
7 4 Berlin
ID 5 = Stockholm with Parent ID = 3
ID 3 = Sweden with Parent ID = 2
ID 2 = Europe with Parent ID = 1
ID 1 = World with no parent
He's looking for something similar to Oracle's "Connect By" clause to
define hierachical data, but I don't know if Firebird has an
equivalent structure.
Scott