home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 649 of 2,288   
   VC to Bernard Drolet   
   Re: Limit the levels for a query with CO   
   06 Nov 03 22:10:08   
   
   From: boston103@hotmail.com   
      
   Hello Bernard,   
      
   If I understand correctly what you want to do, then it's really simple:   
      
   SELECT id, name   
        FROM Mytable   
        WHERE name = 'XYZ'   
        STARTING WITH id = &1   
        CONNECT BY id = PRIOR id AND PRIOR name <>  'XYZ';   
      
      
   Rgds.   
      
      
   "Bernard Drolet"  wrote in message   
   news:ee7856eb.0311050650.4cbb0e2a@posting.google.com...   
   > sybrandb@yahoo.com wrote in message   
   news:...   
   > >   
   > > Hint: there is a LEVEL pseudo function.   
   > >   
   > > Sybrand Bakker   
   > > Senior Oracle DBA   
   >   
   > I have two concerns with LEVEL:   
   >   
   > First,   
   >   
   > I do not know in advance at what level the specific row is ! The table   
   > contains the structure and content of complex SGML documents; the SGML   
   > structure (DTD) can be different from one document to the other and   
   > can even change over time   
   >   
   > (for example, I can have a document with   
   > PUBLICATION - CHAPTER - SECTION - TASK   
   > structure today, but in future, the person in charge of the   
   > publication can decide to add a layer, as in   
   > PUBLICATION - CHAPTER - SECTION - PAGEBLOCK - TASK,   
   > so the level to find the TASK is now changed and the query will not   
   > find it anymore).   
   >   
   > Second,   
   >   
   > Even if I ask to display only the, for example, 3 first LEVELs, am I   
   > right when I say the query will process the complete tree structure   
   > anyway before returning me only the rows I'm interested in ?   
   >   
   >   
   >   
   > Bernard Drolet   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca