By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

SQL Query question

P: n/a
Hi All,
I have a table consists of two fields.

FielChild FieldParent
B1 B2
B2 B3
B3 Null

means that B3 is the parent of B2 & B1
and B2 is the parent of B1, and B1 has no child.

what I need is an sql query that can display the children of B1, B2, and B3.
e.g the result for B3 should look like:

Parent Child
B3 B3
B3 B2
B3 B1
B2 B2
B2 B1
B1 B1

TIA,
andi
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In the Query Builder, include the same table as many times as the
generations you want to have/show, then join it to itself ("self-join"), one
copy after the other. Let the Query Builder generate the SQL for you.

Larry Linson
Microsoft Access MVP

"andi" <an*****@yahoo.com> wrote in message
news:56**************************@posting.google.c om...
Hi All,
I have a table consists of two fields.

FielChild FieldParent
B1 B2
B2 B3
B3 Null

means that B3 is the parent of B2 & B1
and B2 is the parent of B1, and B1 has no child.

what I need is an sql query that can display the children of B1, B2, and B3. e.g the result for B3 should look like:

Parent Child
B3 B3
B3 B2
B3 B1
B2 B2
B2 B1
B1 B1

TIA,
andi

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.