Database Reference
In-Depth Information
Figure 13.4
MINUS Returns
Rows in the First
Query Only.
That covers composite queries using set operators. Now let's look at
hierarchical queries.
13.2
Hierarchical Queries
A hierarchical query allows display of hierarchical data in a single table. The
MUSIC schema described in Chapter 1 contains two tables with a hierar-
chical structure, namely the INSTRUMENT and GENRE tables. How-
ever, the INSTRUMENT table contains hierarchical data, while the
GENRE table does not. The GENRE table contains a single-level hierarchy
and the INSTRUMENT table contains multiple levels. Before we look at
any examples, there are various hierarchical operators and pseudocolumns
we should examine (see Chapter 7).
Note:
The CONNECT BY clause now allows ancestor-descendant
pairs as opposed to only parent-child pairs. In other words, pairs can be
matched and returned where those pairs are not directly related within a
hierarchy but related from the top to the bottom of a hierarchy.
 
Search WWH ::




Custom Search