Re: hierarchy table design question
Date: 2000/05/05
Message-ID: <39131005$0$10088_at_wodc7nh0.news.uu.net>#1/1
With SQL:
select TC.* from TA, TB, TC Where TA.pk = [whatever] and TA.pk = TB.fk and
TB.pk = TC.fk
pk=primary key
fk=foreign key
HTH,
Jon Myers
dtong123_at_my-deja.com wrote in message <8ev0nm$b23$1_at_nnrp1.deja.com>...
>Hello,
>
>Let say I have the following schema.
>
>Table A has a 1-M relationship with Table B.
>Table B has a 1-M relationship with Table C.
>
>I want to get related rows from Table C by given
>Table A's primary key. The following is pseduo
>code from application layer.
>1. Get all related rows from B by providing A's pk
>2. For each row of B, get all rows from c.
>
>U see if I have 1..n rows of B, then I have to
>loop through 1..n times to retrieve Cs. All these
>code is from app layer, and therefor it is
>involved the network traffic..etc.
>
>What is the best way to solve this problem?
>
>Thanks,
>D. T.
>
>
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Fri May 05 2000 - 00:00:00 CEST
