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 2,176 of 2,288   
   Eitan to All   
   Several question about select.   
   25 Jan 06 21:38:19   
   
   XPost: comp.database.oracle, comp.database.oracle.misc, comp.dat   
   base.oracle.server   
   XPost: comp.databases.oracle.misc   
   From: no_spam_please@nospam.com   
      
   Hello,   
   I want a solutions for a compicateds sql select statments.   
      
   The selects can use anything : views, stored procedures, analytic functions,   
   etc...   
   (not use materialized view, unless it is neccessary).   
      
   question 1)   
   The selects can use anything : views, stored procedures, analytic functions,   
   etc...   
   (not use materialized view, unless it is neccessary).   
   Suppose I have the folowing select :   
      
   select x from t   
      
   -- t is a table, and x is numeric column.   
      
   The select statement is fixed and cannot be change.   
   The only change that is allowed is to put a where clause at the end of the   
   select.   
      
   I want that the where clause will influence the result of the select, like   
   the following.   
      
   If I add :   
   where x = 1   
   The result will be : 1   
      
   If I add :   
   where x = 2   
   The result will be : 2   
      
   etc..   
      
   If I could do something like :   
   select rownum   
   from t   
   where rownum = 1   
      
   (the where statement works only for rownum = 1, and then the select return   
   the value : 1).   
      
   The select may use an analitic function etc...   
   ).   
      
   If there is any solution for above , I would like to know please + some code   
   sample.   
      
   question 2)   
      
   I have a binary tree.   
   I want to search the tree in some kind of select statement (Left + Parent +   
   Right).   
   The output should be the binary search of the tree, each row of the select   
   return in the right order the search output.   
      
   I can use stored procedures, package etc...   
   but, at the end I want to use one single select statement for that.   
      
   How can I do that.   
   Need code sample, please.   
      
   Thanks :)   
      
   --- 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