Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL/PL SQL help

Re: SQL/PL SQL help

From: terryg8 <trg_at_ibm.net>
Date: 1997/10/27
Message-ID: <3454A426.7944@ibm.net>#1/1

Rushika Pandya wrote:
>
> I have a table that is a parent/child table. This table has five levels.
> One of the attributes can be defined at any one of these five levels.
> I want to be able to select the level_id where this attribute is not null.
>
> The searching preference is level 5..level1.
>
> I know how to get the attribute value:
> nvl(table5.attribute, nvl(table4.attribute, nvl(table3.attribute,
> nvl(table2.attribute, nvl(table1.attribute, '0')
> but I do not know how to get the corresponding level value...
>
> How would I go about doing this...

How about decoding the attribute values? ie decode(table5.attribute,null,null,5) etc

Cheers,
Terry Received on Mon Oct 27 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US