Database Reference
In-Depth Information
Figure 10.23
Descriptive Form
of the Self-Join in
Figure 10.22.
10.3.4.2
Hierarchical (Fishhook) Self-Join
A hierarchical or fishhook self-join is a tree-like structure where parent rows
have child rows, which can in turn be parent rows of other child rows. A
common use for this type of join is to represent family tree data. The
MUSIC schema used in this topic has two tables containing hierarchical
structures: the INSTRUMENT and GENRE tables. Only the INSTRU-
MENT table contains hierarchical data, in addition to just structure.
SELECT PARENT.NAME "Parent", CHILD.NAME "Child"
FROM INSTRUMENT PARENT JOIN INSTRUMENT CHILD
Search WWH ::




Custom Search