×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to create Master/Detail/Detail/Detail?

How to create Master/Detail/Detail/Detail?

How to create Master/Detail/Detail/Detail?

(OP)

I use Interbase 6 SQLServer in conjunction with Delphi 6 Enterprise.

I have a FATHER (Master), CHILD (Detail), GCHILD (Detail), GGCHILD (Detail) relationship.

I find (Example 1) below works perfectly. But Examples 2 and 3 do not.

Can someone please tell me what I am doing wrong?

Example 2 provides any and all GRANDCHILDREN who have a join to a CHILD and FATHER.
Example 3 provides any and all GREATGRANDCHILDREN who have a join to a GRANDCHILD, CHILD
and FATHER.

which is (of course) ALL of them and is not what I want.

What I want is:
In Example 2 when POINTING to (say) FATHER 2 and (his) CHILD 3 at any given moment I want
ONLY the GRANDCHILDREN of FATHER 2 and CHILD 3.
Equally When POINTING to (say) FATHER 3, (his) CHILD 2 and GRANDCHILD 1 at a given moment
I want to see ONLY the GREAT-GRANDCHILDREN of FATHER 3, CHILD 2 and GRANDCHILD 1.

EXAMPLE 1

select *
from CHILD t1, FATHER t2
where t1.P_NO = t2.P_NO

EXAMPLE 2

select *
from GCHILD t1, CHILD t2, FATHER t3
where (t1.P_NO = t3.P_NO) AND (t1.C_NO = t2.C_NO)

EXAMPLE 3

select *
from GGCHILD t1, GCHILD t2, CHILD t3, FATHER t4
where (t1.P_NO = t4.P_NO) AND (t1.C_NO = t2.C_NO) AND (t1.GC_NO = t3.GC_NO)

Thanks in advance


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close