Hierarchical Selective Expansion

The term "selective expansion" describes a hierarchical query where all the rows at, above, and below a target item are returned. For example, given a data set that looks like this:

PADDED_KEY
---------------
a
  a.a
  a.b
b
  b.a
  b.b
    b.b.a
  b.c
    b.c.a
    b.c.b
    b.c.c
      b.c.c.a
      b.c.c.b
      b.c.c.c
 

a selective expansion of a target item like "b.c.c" would give us the following rows.

PADDED_KEY
---------------
b
  b.c
    b.c.c
      b.c.c.a
      b.c.c.b
      b.c.c.c
 

The tutorials in this section describe various methods for performing a selective expansion. If you are not familiar with hierarchical queries you should review SQL Features Tutorials: Hierarchical Data before proceeding.




Linking to SQL Snippets ™

To link to this page in Oracle Technology Network Forums or OraFAQ Forums cut and paste this code.

  • [url=http://www.sqlsnippets.com/en/topic-10369.html]SQL Snippets: SQL Techniques Tutorials - Hierarchical Selective Expansion[/url]

To link to this page in HTML documents or Blogger comments cut and paste this code.

  • <a href="http://www.sqlsnippets.com/en/topic-10369.html">SQL Snippets: SQL Techniques Tutorials - Hierarchical Selective Expansion</a>

To link to this page in other web sites use the following values.

  • Link Text : SQL Snippets: SQL Techniques Tutorials - Hierarchical Selective Expansion
  • URL (href): http://www.sqlsnippets.com/en/topic-10369.html