Skip to Content
Oracle SQL Revealed: Executing Business Logic in the Database Engine
book

Oracle SQL Revealed: Executing Business Logic in the Database Engine

by Alex Reprintsev
April 2018
Intermediate to advanced
393 pages
6h 8m
English
Apress
Content preview from Oracle SQL Revealed: Executing Business Logic in the Database Engine
© Alex Reprintsev 2018
Alex ReprintsevOracle SQL Revealedhttps://doi.org/10.1007/978-1-4842-3372-6_5

5. Hierarchical Queries: Connect by

Alex Reprintsev1 
(1)
London, UK
 

The connect by clause is used to query hierarchies if they are stored as parent-child relationships , also known as an adjacency lists model . Simply speaking, this model means that a parent – child pair is stored for each child. In general adjacency lists can represent directed graphs, not only hierarchical trees; in this case the list describes the set of neighbors of a vertex in the graph. So an adjacency list model is much wider and a parent-child model is one of its implementations.

Listing 5-1 shows the query for building hierarchy based on a parent-child relationship and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Sam R. Alapati, Darl Kuhn, Bill Padfield

Publisher Resources

ISBN: 9781484233726Purchase LinkPublisher Website