Connecting Tech Pros Worldwide Forums | Help | Site Map

Several question about select.

Eitan
Guest
 
Posts: n/a
#1: Jan 25 '06
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
Guest
 
Posts: n/a
#2: Jan 26 '06

re: Several question about select.


Eitan wrote:[color=blue]
> 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).[/color]

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)
DA Morgan
Guest
 
Posts: n/a
#3: Jun 27 '08

re: Several question about select.


Eitan wrote:
Quote:
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)
Closed Thread