|
Home > Archive > Oracle Databases > January 2006 > Several question about select.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Several question about select.
|
|
|
| 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 :)
| |
| DA Morgan 2006-01-26, 5:02 pm |
| Eitan wrote:
> 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).
Lets stop right here. First I see you posted this to every usenet group
you could spell. That is not going to make you a single friend and an
apology is appropriate.
Second ... if you can use a Stored Procedure in a query I'd be
fascinated to see you syntax.
I'd suggest following your apology to all you post a single new query
asking for help in the appropriate group, c.d.o.server and actually
explain what it is you are doing (WITH CLARITY) and include your version
number. I'm not going to play guessing games with this.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)
|
|
|
|
|