Advertisement

04.28.2007 at 01:18AM PDT, ID: 22539986
[x]
Attachment Details

Retrieve all children and descendants

Asked by Jaax in Databases Miscellaneous

Tags:

Hello Experts,
  I have a two-column table defined, as follows, for representing the tree structure :

CREATE TABLE PARENT_CHILD (
  ID  VARCHAR(5) NOT NULL PRIMARY KEY
  PID VARCHAR(5) FOREIGN KEY REFERNCES PARENT_CHILD
)

 Is it possible with a single standard SQL query, without any proprietary features, to retrieve all the children and all its descendants down the lineage ?

 Start Free Trial
[+][-]04.28.2007 at 03:37AM PDT, ID: 18994025

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Databases Miscellaneous
Tags: query
Sign Up Now!
Solution Provided By: f_o_o_k_y
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.28.2007 at 05:03AM PDT, ID: 18994121

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2007 at 01:56AM PDT, ID: 19035748

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32