Re: Connect by Clause?? Whoo-Nelly.....

From: Chris Leonard <chris_at_databaseguy.com>
Date: 18 Jul 2002 12:47:16 -0700
Message-ID: <b8cc3cda.0207181147.30824d6e_at_posting.google.com>


Try this:

   select max(new_site_key)
   from site_history
   connect by prior new_site_key = site_key    start with site_key =

      (select site_key
       from   group_upload
       where  group_num = '&USER_INPUT')

Hope this helps,
Chris



Chris Leonard
MCSE, MCDBA, MCT, OCP, CIW
The Database Guy at PPI
http://www.propoint.com
Brainbench MVP for Oracle Admin
http://www.brainbench.com

treoo0_at_yahoo.com (Treo) wrote in message news:<c631ca9c.0207180512.3c8db874_at_posting.google.com>...
> ((can use Access's 'pass-through' query to utilize Oracle's
> functions))
>
> Greetings,
>
> Connect-by clause?? Seriously lost.....any syntax please....
>
> 2 tables:
>
> Group_Upload Site_History
> ------------ ------------
> Group_Num Site_Key
> Site_Key New_Site_Key
>
> A user will upload a group of Site Keys in the Group_Upload table, and
> specify the group using Group_Num. What I need help w/ is as
> follows...
>
> (probably using connect by clause??)
>
> If the Tables looked like this:
>
> Site_History | Group_Upload
> ---------------------- | ---------------------
> Site_Key | New_Site_Key | Group_Num | Site_Key
> 1 | 2 | ABC44 | 1
> 2 | 3 | |
> 3 | 4 | |
>
> User specifies Group_Num "ABC44" and the Site_Key in Group_Upload
> table was "1", then it would return "4" (don't need 2 or 3 nodes, just
> the final "Leaf"...
>
> Any gurus help w/ this? Thanks (more than you could know!)
Received on Thu Jul 18 2002 - 21:47:16 CEST

Original text of this message