Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT CONNECT BY...
On 24 Feb 1998 10:26:34 GMT, "dicaprio" <dicaprio_at_tin.it> wrote:
Hi,
here's somthing form J.P.Higgins:
columns lev format a15
Select
lpad(level,level*2) lev, region_name
from
region
start with parent_region is null
connect by prior parent_region = region_id
;
where table region looks like:
region_id CHAR(4) REGION_NAME VARCHAR2(40) parent_region CHAR(4)
Hope this helps.
>Hi,
>
>Someone can help me with an example about :
>
> "You use LEVEL with the SELECT CONNECT BY statement to organize rows from
>a database table into a tree structure. LEVEL returns the level number of a
>node in a tree structure. The root is level 1, children of the root are
>level 2, grandchildren are level 3, and so on..."
>
>Thanks in advances
>Veramente Grato....
>
> Clemente di Caprio
>
>dicaprio_at_tin.it
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Wed Feb 25 1998 - 00:00:00 CST