Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help writing SQL query
Hi ana, a family is anyone related anyway to anyone else in this model.
Basically for Brians family, there exists some sort of connectivity between
Francis, Bruce, Claudine, Peter, Brian, Joan, and Bob but no connectivity to
Francois etc.
Brian and Mary are related as the names Brian and Mary exist as one of the rows in the table "family". Mary and Bob are related because the names Mary and Bob exist as one of the rows in the table. Therefore Brian, Mary, and Bob (and all other others) are related and I want to be able to pull them out from the remainder of the data in the table.
FWI ultimately I need to retrieve each of the families GROUP BY so I can put
them into a more usable structure. Sadly however the data isn't very clean
either so I will be massaging considerably before I do this. At the moment I
just want proof that I can go SELECT personname FROM something WHERE family
is someone in the family. I'll work on the other more laborious bits later.
Hope this explains it a bit further.
Barry
"ana" <anacedent_at_hotmail.com> wrote in message
news:31mf2bF3dq0v6U1_at_individual.net...
> "Barry Bulsara" <bbulsara23_at_hotmail.com> wrote in message
> news:1102447259.4791.0_at_lotis.uk.clara.net...
>>
>> Daniel, I can't change the structure. I am not designing this, it is
>> what
> I
>> have to work with, and I have to get the information into a proper
>> structure.
>> The reason I have chosen familymember1 and 2 and the contrived data is to
>> make the explanation simple and hopefully get on the road to a simple
> query.
>> Regards
>> Barry
>
> It is NOT clear to this reader the relationship between familymember1 &
> familymember2;
> other than somehow they are related to each other.
>
> What gets reported for cases where more than TWO generations are in the
> table?
>
> Why only TWO members in the table when every child has a mother and a
> father?
> Dick marries Jane and have two kids John & Sue.
> John grows up, marries Sally and has Jeremy & Nadine.
> Sue grows up married Ted & has Samantha & Tyler.
> What's in your DB for this case & who gets reported as a "family"?
>
>
Received on Tue Dec 07 2004 - 15:00:49 CST
![]() |
![]() |