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 -> Several question about select.

Several question about select.

From: Eitan <no_spam_please_at_nospam_please.com>
Date: Thu, 26 Jan 2006 09:10:27 +0200
Message-ID: <dr9sf6$ij4$1@news2.netvision.net.il>


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

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 :) Received on Thu Jan 26 2006 - 01:10:27 CST

Original text of this message

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