Re: CRAZY JOIN

From: Gene Maillet <gm_at_formalsys.ca>
Date: 1996/10/25
Message-ID: <3270D9B0.546_at_formalsys.ca>#1/1


David Turner wrote:
>
> If anyone can help me with this problem I'd really appreciate it and I'll
> definitely add you to my list of oracle gods.
>
> I have two tables
>
> GROUP_TABLE GROUP_SUB_GROUP_TABLE
> ------------------ ------------------------
> PK GROUP_ID |-----------------| LEVEL1_ID |
> DESCRIPTION | \ | |
> LEVEL | \-------| LEVEL2_ID |
> ------------------ \ | |
> \-----| LEVEL3_ID |
> ------------------------
>
> I would like a select statement that will print each row in the
> group_sub_group_table with the description rather than the id
>
> ex:
>
> president, no_sub, no_sub
> president, vice-pres,no_sub
> president, secr,no_sub
> president, vice-pres, office_sup
> president, vice-pres, administrative_serv
> president, vice-pres, gra
>
> Thanks in advance, David

I am not sure I understand completely what you are looking for, but try

select grp1.description, grp2.description, grp3.description from group_sub_group_table gsg, group_table grp1, group_table grp2, group_table grp3

where gsg.level1_id = grp1.group_id 
and   gsg.level2_id = grp2.group_id 
and   gsg.level3_id = grp3.group_id;

Good luck,

Gene M. Received on Fri Oct 25 1996 - 00:00:00 CEST

Original text of this message